Skip to content

Commit

Permalink
add more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock authored and alexpop committed May 10, 2016
1 parent c23406e commit 289f8a7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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] : []
Expand Down

0 comments on commit 289f8a7

Please sign in to comment.