-
Notifications
You must be signed in to change notification settings - Fork 682
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
jUnit reports are hard to read #1438
Comments
👍 |
This work will require us to build a junit reporter being based on-top of our InSpec JSON format instead of RSpec |
I put the original junit reporter together and came here to log the same issue so I can cobble together a PR in the next week or two but you did all the hard work for me 👍 I'll see what I can do with this assuming nobody else picks it up first |
Well on the way here. the mapping is like so: Any feedback would be appreciated @ryancurrah @chris-rock @aaronlippold . Items to still accomplish:
Format:
|
Wow looking good @jkerry. I imported your jUnit into a test Jenkins job it's a lot easier to read. Screenshots below. Only comment in addition to your TODO is add run time to the results as well. I took a look at the code. Based on @chris-rock feedback it looks like the class InspecRspecJUnit has to look a lot more like InspecRspecJson. Seems @jkerry has made more progress than I have. If you need more help let me know. |
Thanks! That's exactly right on the formatter. I'm actually cheating and using nokogiri to build the xml up from the output hash that the json formatter rolls up. Not the most efficient allocation of resources but it'll do. I'll get a PR submitted tomorrow morning. |
@ryancurrah PR submitted. Would you have time to build the PR and run a test or two to make sure it fits what you're looking for? |
Hey @jkerry just built off of your feature branch on my rhel7 vagrant box. It worked like a charm, the results are WAYYY more readable now. This is awesome man. I imported the results into Jenkins just fine too. Here is the gist of the resulting jUnit file https://gist.github.com/ryancurrah/f8ca7f5606a11e83f06fc27f1a8821bb. And screenshots below. My only comment, which is minor at this point. Is it would be nice if the tests are organized under the control name. Would be pretty cool but not a show stopper. I have some down time, i'll see if can figure it out. |
You can only organize under one thing so it would have to be profile or control ( the control is in the class field for the test cases ) @chris-rock what's better for the product: picking one of these and running with it or adding some kind of runtime config / flag to make it user selectable? |
Description
The jUnit exporter is organizing tests under invalid control names. This makes it really hard to read when importing tests results into test reporting tools.
InSpec and Platform Version
InSpec version:
1.9.0
Platform version:
RedHat 7.2
Replication Case
audit_config_spec.rb:
jUnit report: junit_report.txt
InSpec report: inspec_report.txt
Main test results page:
tmp..inspec.cache.91e12bdaec14f85c7bb7bf2d7c6177ea821175ef.controls page:
As you can see a bunch of controls are missing. They seem to appear under usr.lib64.ruby.gems.2.3.0.gems.inspec-1.9.0.lib.inspec:
Possible Solutions
Not sure yet I will take a look at the code when I have a chance.
Stacktrace
Not applicable
The text was updated successfully, but these errors were encountered: