diff options
| author | Alyssa Ross | 2016-09-20 14:57:08 +0100 |
|---|---|---|
| committer | Alyssa Ross | 2016-09-20 15:48:00 +0100 |
| commit | 869fb0214971f3dbcccbe1915702ffc7e7d69d16 (patch) | |
| tree | 6387cb0b1eda2faec16e1d3eb82a4971d3691497 /Library/Homebrew | |
| parent | 651303f62df934d61dd3c317b84b417537d91d8b (diff) | |
| download | brew-869fb0214971f3dbcccbe1915702ffc7e7d69d16.tar.bz2 | |
tests, cask-tests: serialize stdout on CI
Diffstat (limited to 'Library/Homebrew')
| -rwxr-xr-x | Library/Homebrew/cask/cmd/brew-cask-tests.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/tests.rb | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/Library/Homebrew/cask/cmd/brew-cask-tests.rb b/Library/Homebrew/cask/cmd/brew-cask-tests.rb index 019c3ca24..2523061a2 100755 --- a/Library/Homebrew/cask/cmd/brew-cask-tests.rb +++ b/Library/Homebrew/cask/cmd/brew-cask-tests.rb @@ -1,7 +1,10 @@ require "English" def run_tests(executable, files, args = []) - system "bundle", "exec", executable, "--", *args, "--", *files + opts = [] + opts << "--serialize-stdout" if ENV["CI"] + + system "bundle", "exec", executable, *opts, "--", *args, "--", *files end repo_root = Pathname(__FILE__).realpath.parent.parent diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index aba2fa3b6..9b15f9f3e 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -41,16 +41,24 @@ module Homebrew files = Dir["test/test_*.rb"] files -= Dir["test/test_os_mac_*.rb"] unless OS.mac? + + opts = [] + opts << "--serialize-stdout" if ENV["CI"] + args = [] args << "--trace" if ARGV.include? "--trace" + if ARGV.value("only") ENV["HOMEBREW_TESTS_ONLY"] = "1" test_name, test_method = ARGV.value("only").split("/", 2) files = ["test/test_#{test_name}.rb"] args << "--name=test_#{test_method}" if test_method end + args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] } - system "bundle", "exec", "parallel_test", "--", *args, "--", *files + + system "bundle", "exec", "parallel_test", *opts, + "--", *args, "--", *files Homebrew.failed = !$?.success? |
