Skip to content

Commit

Permalink
Process transitive dependencies from lock file
Browse files Browse the repository at this point in the history
This is a regression introduced by the changes from string to symbol
keys in v0.34.0. It seems that our test cookbook that had a nested
dependency example wasn't actually wired up to run.

This adds a basic functional test and corrects the typo.

Signed-off-by: Steven Danna <steve@chef.io>
  • Loading branch information
stevendanna committed Sep 15, 2016
1 parent 8899c75 commit 0bbcbcb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/inspec/dependencies/requirement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def self.from_lock_entry(entry, cwd, vendor_index, backend)
entry[:resolved_source].merge(backend: backend))

locked_deps = []
Array(entry['dependencies']).each do |dep_entry|
Array(entry[:dependencies]).each do |dep_entry|
locked_deps << Inspec::Requirement.from_lock_entry(dep_entry, cwd, vendor_index, backend)
end
req.lock_deps(locked_deps)
Expand Down
9 changes: 9 additions & 0 deletions test/functional/inspec_exec_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@
end
end

describe "with a 2-level dependency tree" do
it 'correctly runs tests from the whole tree' do
out = inspec('exec ' + File.join(profile_path, 'dependencies', 'inheritance'))
out.stderr.must_equal ''
out.exit_status.must_equal 0
out.stdout.force_encoding(Encoding::UTF_8).must_include "Summary: \e[32m6 successful\e[0m, \e[31m0 failures\e[0m, \e[37m0 skipped\e[0m\n"
end
end

describe 'when using profiles on the supermarket' do
it 'can run supermarket profiles directly from the command line' do
out = inspec("exec supermarket://nathenharvey/tmp-compliance-profile")
Expand Down

0 comments on commit 0bbcbcb

Please sign in to comment.