Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more debug messages #82

Merged
merged 1 commit into from
May 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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