diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index 7eac37a..655ee38 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -38,12 +38,15 @@ class Inspec < Kitchen::Verifier::Base # rubocop:disable Metrics/ClassLength # (see Base#call) def call(state) - tests = collect_tests + logger.debug('Initialize InSpec') opts = runner_options(instance.transport, state) runner = ::Inspec::Runner.new(opts) + + # add each profile to runner + tests = collect_tests tests.each { |target| runner.add_target(target, opts) } - debug("Running specs from: #{tests.inspect}") + logger.debug("Running tests from: #{tests.inspect}") exit_code = runner.run return if exit_code == 0 fail ActionFailed, "Inspec Runner returns #{exit_code}" @@ -91,7 +94,7 @@ def local_suite_files } base = File.join(base, 'inspec') if legacy_mode - logger.info("Search `#{base}` for tests") + logger.info("Use `#{base}` for testing") # only return the directory if it exists Pathname.new(base).exist? ? [base] : []