-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add support for JUnit reports #91
Conversation
@onlineque Let me know when this is ready for review |
@kehoecj It should be ready for the review, could you please take a look ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@onlineque Test coverage has dropped below the required coverage threshold (95%) which is causing the unit tests job to fail. Please improve the coverage so that is meets the threshold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I build and run locally to generate a junit output, I see the following entry that appears to use HTML entity codes in the XML. Why are those codes being used? They are not used in the other reporter output formats (json and standard)
<testcase name="fixtures/subdir/bad.yml validation" classname="config-file-validator" file="fixtures/subdir/bad.yml">
<failure>
<message>yaml: line 3: did not find expected '-' indicator</message>
</failure>
</testcase>
Please increase your test coverage so that the coverage is above 95% and the pipeline succeeds. |
it renders correctly once opened in any browser / tool which is able to render XML. From my point of view this is correct. |
It really only looks good in the browser. Viewing in VSCode, on the command line, or any other tool shows the HTML encoded output which is difficult to read. The primary intent for offering a Junit reporter - at least in my mind - was for use with CI tools like Gitlab CI that can take a JUnit XML as a report. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good overall with a few comments. I tested locally and was able to generate valid JUnit XML. Tested the output in a sample Gitlab CI job using the JUnit reporter and which worked as expected to include config-file-validation reporting in the Gitlab CI pipeline testing section.
A couple code changes/questions and the remaining question on encoded XML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. Thanks for fixing the XML output to be human readable everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you for the contribution!
* initial commit * junit report test * tests updated * tests * fix html entities encoding, split checkPropertyValidity into several functions --------- Co-authored-by: Vladimir Siman <online@clew.cz>
* initial commit * junit report test * tests updated * tests * fix html entities encoding, split checkPropertyValidity into several functions --------- Co-authored-by: Vladimir Siman <online@clew.cz>
fixes #10