Fix scorecard XUnit output#5652
Merged
jmrodri merged 1 commit intooperator-framework:masterfrom Apr 13, 2022
Merged
Conversation
Currently, scorecard's XUnit output does not conform to any XUnit
schema. This makes the scorecard XUnit output conform with the XUnit
schema defined by the Jenkins XUnit plugin.
This is sample output from running scorecard against the sample Go v3
Memcached operator:
```xml
<testsuites name="scorecard">
<testsuite name="olm-bundle-validation-test" tests="1" skipped="0" failures="0" errors="0">
<properties>
<property name="spec.image" value="quay.io/operator-framework/scorecard-test:v1.19.0"></property>
<property name="spec.entrypoint" value="scorecard-test olm-bundle-validation"></property>
<property name="labels.test" value="olm-bundle-validation-test"></property>
</properties>
<testcase name="olm-bundle-validation" time="0001-01-01T00:00:00Z">
<system-out>time=&operator-framework#34;2022-04-12T19:21:52Z&operator-framework#34; level=debug msg=&operator-framework#34;Found manifests directory&operator-framework#34; name=bundle-test
time=&operator-framework#34;2022-04-12T19:21:52Z&operator-framework#34; level=debug msg=&operator-framework#34;Found metadata directory&operator-framework#34; name=bundle-test
time=&operator-framework#34;2022-04-12T19:21:52Z&operator-framework#34; level=debug msg=&operator-framework#34;Getting mediaType info from manifests directory&operator-framework#34; name=bundle-test
time=&operator-framework#34;2022-04-12T19:21:52Z&operator-framework#34; level=debug msg=&operator-framework#34;Found annotations file&operator-framework#34; name=bundle-test
time=&operator-framework#34;2022-04-12T19:21:52Z&operator-framework#34; level=debug msg=&operator-framework#34;Could not find optional dependencies file&operator-framework#34; name=bundle-test
</system-out>
</testcase>
</testsuite>
<!-- Some suites omitted for readability -->
</testsuites>
```
The full output can be recreated by installing the `operator-sdk` tool
built from this commit and running scorecard against the sample Go v3
memcached operator:
```
cd /path/to/operator-sdk
make install
operator-sdk scorecard testdata/go/v3/memcached-operator
```
The XUnit XSD schema can be found here:
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
The tool used to validate the output against the schema can be found
here: https://www.freeformatter.com/xml-validator-xsd.html
Signed-off-by: Ryan King <ryking@redhat.com>
theishshah
approved these changes
Apr 12, 2022
Contributor
|
/lgtm what scorecard config did you use? i just pulled the default one from the docs and can confirm it works with that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, scorecard's XUnit output does not conform to any XUnit
schema. This makes the scorecard XUnit output conform with the XUnit
schema defined by the Jenkins XUnit plugin.
This is sample output from running scorecard against the sample Go v3
Memcached operator:
The full output can be recreated by installing the
operator-sdktoolbuilt from this commit and running scorecard against the sample Go v3
memcached operator:
The XUnit XSD schema can be found here:
https://github.com/jenkinsci/xunit-plugin/blob/master/src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
The tool used to validate the output against the schema can be found
here: https://www.freeformatter.com/xml-validator-xsd.html
Signed-off-by: Ryan King ryking@redhat.com