inspec / kitchen-inspec

Test-Kitchen Plugin for InSpec
Other
109 stars 58 forks source link

%{platform} and %{suite} placeholders on reporter option are being applied wrong, it doesn't work at all now #202

Closed wiebe closed 6 years ago

wiebe commented 6 years ago

Pull request #200 breaks the reporter option all together, seems like this was not tested at all? This is because the reporter option now supports multiple reporters and expect it in a array, not as a string. I did a earlier pull request that did implement it correctly, i'll rebase and pull request again.

In my .kitchen.yml:

verifier:
  name: inspec
  sudo: true
  reporter: junit:build-logs/acceptance.inspec.%{suite}.%{platform}.xml

Error and backtrace i get:

E, [2018-09-07T13:40:51.116037 #18274] ERROR -- Kitchen: ---Nested Exception---
E, [2018-09-07T13:40:51.116049 #18274] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2018-09-07T13:40:51.116061 #18274] ERROR -- Kitchen: Message: Failed to complete #verify action: [undefined method `each' for #<String:0x0000559c42a7d800>]
E, [2018-09-07T13:40:51.116073 #18274] ERROR -- Kitchen: ----------------------
E, [2018-09-07T13:40:51.116085 #18274] ERROR -- Kitchen: ------Backtrace-------
E, [2018-09-07T13:40:51.116097 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/inspec-2.2.78/lib/inspec/base_cli.rb:179:in `validate_reporters'
E, [2018-09-07T13:40:51.116110 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/inspec-2.2.78/lib/inspec/base_cli.rb:158:in `parse_reporters'
E, [2018-09-07T13:40:51.116136 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/inspec-2.2.78/lib/inspec/runner.rb:47:in `initialize'
E, [2018-09-07T13:40:51.116163 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/bundler/gems/kitchen-inspec-2a61c9e4496d/lib/kitchen/verifier/inspec.rb:81:in `new'
E, [2018-09-07T13:40:51.116195 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/bundler/gems/kitchen-inspec-2a61c9e4496d/lib/kitchen/verifier/inspec.rb:81:in `call'
E, [2018-09-07T13:40:51.116218 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:458:in `block in verify_action'
E, [2018-09-07T13:40:51.116231 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:551:in `synchronize_or_call'
E, [2018-09-07T13:40:51.116243 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:513:in `block in action'
E, [2018-09-07T13:40:51.116264 #18274] ERROR -- Kitchen: /usr/share/ruby/benchmark.rb:293:in `measure'
E, [2018-09-07T13:40:51.116278 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:512:in `action'
E, [2018-09-07T13:40:51.116291 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:450:in `verify_action'
E, [2018-09-07T13:40:51.116304 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:382:in `block (2 levels) in transition_to'
E, [2018-09-07T13:40:51.116317 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/lifecycle_hooks.rb:45:in `run_with_hooks'
E, [2018-09-07T13:40:51.116329 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:381:in `block in transition_to'
E, [2018-09-07T13:40:51.116343 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `each'
E, [2018-09-07T13:40:51.116356 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:380:in `transition_to'
E, [2018-09-07T13:40:51.116369 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/instance.rb:162:in `verify'
E, [2018-09-07T13:40:51.116382 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `public_send'
E, [2018-09-07T13:40:51.116394 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:197:in `run_action_in_thread'
E, [2018-09-07T13:40:51.116408 #18274] ERROR -- Kitchen: /home/wiebe/Projects/puppet/vendor/bundle/ruby/2.5.0/gems/test-kitchen-1.23.2/lib/kitchen/command.rb:169:in `block (2 levels) in run_action'
E, [2018-09-07T13:40:51.116421 #18274] ERROR -- Kitchen: ----End Backtrace-----
jquick commented 6 years ago

Thanks for this @wiebe , I will get a fix and tests in today for this.

jquick commented 6 years ago

Actually thank you for the fix already :D

jquick commented 6 years ago

Fixed via https://github.com/inspec/kitchen-inspec/pull/203