12

I am investigating if ChefSpec report (with coverage) and Test Kitchen report can be generated as junit format so they can be parsed then by Jenkins to publish results. Or if there is some other friendly way those results could be published by Jenkins.

Thanks.

Edit 1: Sorry if I explain incorrectly, but I know that chefspec is for unittest and test kitchen is for integration test. What I meant in this question is how to get test result reports (for both, chefspec and in another hand test kitchen) in a format that can be parsed by Jenkins (such as junit format).

user2620348
  • 309
  • 4
  • 15

2 Answers2

25

You are confusing unit testing and integration testing. ChefSpec is a unit testing framework. It does not perform a real converge and runs everything in memory. Test Kitchen is an integration framework. It uses VMs to actually run Chef on a real machine.

They are different parts of your build. You don't run ChefSpec from Test Kitchen or visa versa.

As far as getting machine-parseable output from the ChefSpec report, that's on my list of things to do. I want something that is more flexible than just JSON though, and I would like users to be able to supply their own templates as well.

Sources:

  • I wrote ChefSpec
  • I'm on Test Kitchen core
sethvargo
  • 26,739
  • 10
  • 86
  • 156
  • Hey @sethvargo, The rspec_junit_formatter gem allows rpsec to format its output in xunit format using the argument '--format RspecJunitFormatter'. I am not sure if this will work with the chefspec code coverage feature. I have not tried that feature yet. Soon, soon. :) – punkle May 11 '14 at 10:31
  • Thanks a lot both for responses. Yes, I tried that feature --format RspecJunitFormatter and works ok with rspec unittest. But I haven't figured out yet how to get a Jenkins friendly parse for Coverage. Did you have success with Coverage? Thanks. – user2620348 May 24 '14 at 00:21
0

While it seems that there was such a functionality to at least output it as JSON, it looks like this feature was removed. See discussion here:

So, how can I get a coverage file report to raise to Jenkins for example?

You can parse the output as a table. I'm working on a way for users to supply "custom" formatters, but haven't come up with a good solution yet.

Community
  • 1
  • 1
StephenKing
  • 36,187
  • 11
  • 83
  • 112