Skip to content

Commit

Permalink
Merge pull request #82 from chef/chris-rock/debug
Browse files Browse the repository at this point in the history
add more debug messages
  • Loading branch information
alexpop committed May 10, 2016
2 parents c23406e + 289f8a7 commit c3b1421
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 c3b1421

Please sign in to comment.