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.
Summary
When testExtensionSchemaValidation tests fail, the reason behind those failures are not logged. This PR replaces
Assert
withSoftAssert
to always output the reason for failure in the unit tests. Below are some example outputs:Before change:
After change:
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.