Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
fix bug where builds still pass if they fail. Related to #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Aug 17, 2012
1 parent de3fd2a commit bf87148
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/strainer/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ def initialize(sandbox, options = {})
@cookbooks = @sandbox.cookbooks
@options = options

# need a variable at the root level to track whether the
# build actually passed
success = true

@cookbooks.each do |cookbook|
$stdout.puts
$stdout.puts Color.negative{ "# Straining '#{cookbook}'" }.to_s

commands_for(cookbook).collect do |command|
success = run(command)
success &= run(command)

if fail_fast? && !success
$stdout.puts [ label_with_padding(command[:label]), Color.red{ 'Exited early because --fail-fast was specified. Some tests may have been skipped!' } ].join(' ')
Expand All @@ -20,6 +24,9 @@ def initialize(sandbox, options = {})

$stdout.puts
end

# fail unless all commands returned successfully
abort unless success
end

private
Expand Down
2 changes: 1 addition & 1 deletion strainer.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Gem::Specification.new do |gem|
gem.version = '0.0.3'
gem.version = '0.0.4'
gem.authors = ['Seth Vargo']
gem.email = ['sethvargo@gmail.com']
gem.description = %q{Run isolated cookbook tests against your chef repository with Strainer.}
Expand Down

0 comments on commit bf87148

Please sign in to comment.