aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorKaito Udagawa2016-11-10 08:50:21 +0900
committerKaito Udagawa2016-11-12 11:48:12 +0900
commit1a4eb14b1642bbdddf0e51aa7894c562b5afc87a (patch)
treec4e815add84b8d41d387bb70cb650182f11aab08 /Library
parent0f6cd9d7a51108497974cae52f177c9a8c57c0ed (diff)
downloadbrew-1a4eb14b1642bbdddf0e51aa7894c562b5afc87a.tar.bz2
cask-tests: fix cask-tests always fail on the test failure
`brew cask-tests` collected the test results in an improper way so that it reports a false success in certain situations. Specially, the session under BrewTestBot always reports success regardless of the test status. With this update, the exit code of `brew cask-tests` is 1 when the test fails, and then CI preperly works.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/cask/cmd/brew-cask-tests.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/cmd/brew-cask-tests.rb b/Library/Homebrew/cask/cmd/brew-cask-tests.rb
index 3126490e3..0bfc4b037 100755
--- a/Library/Homebrew/cask/cmd/brew-cask-tests.rb
+++ b/Library/Homebrew/cask/cmd/brew-cask-tests.rb
@@ -26,6 +26,8 @@ repo_root.cd do
ENV["HOMEBREW_TESTS_COVERAGE"] = "1" if ARGV.flag?("--coverage")
+ failed = false
+
if rspec
run_tests "parallel_rspec", Dir["spec/**/*_spec.rb"], %w[
--color
@@ -34,15 +36,17 @@ repo_root.cd do
--format ParallelTests::RSpec::RuntimeLogger
--out tmp/parallel_runtime_rspec.log
]
+ failed ||= !$CHILD_STATUS.success?
end
if minitest
run_tests "parallel_test", Dir["test/**/*_test.rb"]
+ failed ||= !$CHILD_STATUS.success?
end
+ Homebrew.failed = failed
+
if ENV["CODECOV_TOKEN"]
system "bundle", "exec", "rake", "test:coverage:upload"
end
-
- Homebrew.failed = !$CHILD_STATUS.success?
end