diff options
| -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? |
