From 09976b4c294a0252e02b1a0f9eb7d044ee6f9cc9 Mon Sep 17 00:00:00 2001 From: Wiebe Verweij Date: Fri, 7 Sep 2018 14:11:06 +0200 Subject: [PATCH] Fix platform and suite placeholders being applied incorrectly on reporter option (#203) It is and should be an array, not a string. Signed-off-by: Wiebe Verweij --- README.md | 4 +++- lib/kitchen/verifier/inspec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a8b475..b686abd 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,9 @@ If you want to customize the output file per platform or test suite you can use ```yaml verifier: name: inspec - reporter: junit:path/to/results/%{platform}_%{suite}_inspec.xml + reporter: + - cli + - junit:path/to/results/%{platform}_%{suite}_inspec.xml ``` You can also decide to only run specific controls, instead of a full profile. This is done by specifying a list of controls: diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index bf1071e..6f0187a 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -202,7 +202,7 @@ def runner_options(transport, state = {}, platform = nil, suite = nil) # rubocop runner_options["format"] = config[:format] unless config[:format].nil? runner_options["output"] = config[:output] % { platform: platform, suite: suite } unless config[:output].nil? runner_options["profiles_path"] = config[:profiles_path] unless config[:profiles_path].nil? - runner_options["reporter"] = config[:reporter] % { platform: platform, suite: suite } unless config[:reporter].nil? + runner_options["reporter"] = config[:reporter].map { |s| s % { platform: platform, suite: suite } } unless config[:reporter].nil? runner_options[:controls] = config[:controls] # check to make sure we have a valid version for caching