Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase verbosity of testExtensionSchemaValidation tests #1010

Merged
merged 10 commits into from
Jul 23, 2024

Conversation

SpencerKwok
Copy link
Contributor

@SpencerKwok SpencerKwok commented Jul 11, 2024

Summary

When testExtensionSchemaValidation tests fail, the reason behind those failures are not logged. This PR replaces Assert with SoftAssert to always output the reason for failure in the unit tests. Below are some example outputs:

Before change:

Failure message for com.linkedin.restli.tools.data.TestExtensionSchemaValidationCmdLineApp > testExtensionSchemaValidation[0](validCase, true, null):
    The following asserts failed:
        expected [true] but found [false]

After change:

Failure message for com.linkedin.restli.tools.data.TestExtensionSchemaValidationCmdLineApp > testExtensionSchemaValidation[0](validCase, true, null):
    The following asserts failed:
        expected [true] but found [false],
        expected [null] but found [versionSuffix value: 'V3' does not match the versionSuffix value which was defined in resourceKey/grpcService annotation]

In addition, this PR updates ValidateExtensionSchemaTask to output schema validation errors to the build log.

More information can be found at SI-40347.

Tests

I manually modified valid test cases to be invalid and invalid test cases to be valid to check for error message improvements.

@SpencerKwok SpencerKwok marked this pull request as ready for review July 19, 2024 22:48
Copy link
Contributor

@zackthehuman zackthehuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@zackthehuman zackthehuman merged commit eaef65f into linkedin:master Jul 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants