-
Notifications
You must be signed in to change notification settings - Fork 683
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
Adding JUnit formatter support #1304
Conversation
…tter and including it in the formatters list with key 'junit' Signed-off-by: jkerry <john@kerryhouse.net>
@jkerry Awesome addition. To ensure a higher quality of our code, we require integration/functional tests. Could you add some functional tests? See https://github.com/chef/inspec/blob/master/test/functional/inspec_exec_json_test.rb as an example. Just create a |
Will do. Its going to take me a few to wrap my head around mocking the rspec formatter components |
You do not need to mock them. Just use the functional tests and parse the xml output as we do with the functional test for json. This allows us to ensure the user facing behavior works all the time. Something like:
|
Nifty, thanks for the head start. I'll get the pr ammended tonight |
thanks @jkerry |
Ran into an issue last night that's got me in slow'n'careful mode. The generated XML has a duplicate entry in one of the example runs and I need to make sure that's an intentional edge case |
Oh cool, thanks again @jkerry |
@stevaaa if you want to test it I'd be appreciative. You can pull the branch down, build the gem, uninstall inspec and install the gem with the --local flag. ( Or I can cut a gem and put it in an web accessible place ). Ive confirmed that I can get Jenkins to load the file on a toy project but haven't tried anything at scale |
… xml Signed-off-by: jkerry <john@kerryhouse.net>
06a0e92
to
3ee2808
Compare
Pushing changes so I can continue on another rig. Not ready to merge |
@jkerry Okay, I will test it btw, what is the flag should i use as the --formatter? |
junit |
@jkerry I managed to build and use the junit formatter from your branch. It works! |
Let's also document how to use it. Referencing external tutorials is one great way. Another way would be to add core documentation for Jenkins+Inspec |
I'm happy to write up a tutorial for Jenkins and pr into the docs. I'm concerned though since @stevaaa found a test count discrepancy. Any idea what the gap is yet? |
Maybe it's counting the suite |
verified that the generated xml matches up with the mini-json formatter so I'll finish the tests up and we're good to go |
@jkerry I found the problem, it was skipping identical tests. Now I changed my suite and now able to get the actual test results in xml and bamboo as well. tx |
Hey, thanks for the work testing it. I'll have the rest of the tests ready to rock in a few hours. |
c91cc98
to
23fb82a
Compare
Signed-off-by: jkerry <john@kerryhouse.net>
23fb82a
to
944040f
Compare
yum install failed. doesn't seem right given the changes here. can you re-trigger the travis build @chris-rock ? |
Signed-off-by: jkerry <john@kerryhouse.net>
nifty, pushed a new commit and the build passed. This is ready to rock @chris-rock @stevaaa |
thanks @jkerry 👍 |
thanks @chris-rock. I updated the blog post here to walk through the usage. I'll pull down the chef documentation repo soon and add something for the junit format flag. |
@jkerry InSpec 1.6.0 is released now |
Post updated to reflect ^ |
resolves #1301 by adding a simple empty shell class extension to the JUnit rspec formatter provided in the rspec_junit_formatter gem. A dependency to the latest version of this gem is also included.
Signed-off-by: jkerry john@kerryhouse.net