diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d5b25b2b5f..f587c62959 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,6 +201,16 @@ jobs: - name: Install Bundler RubyGems run: brew install-bundler-gems + - name: Create parallel test log directory + run: mkdir tests + + - name: Cache parallel tests log + uses: actions/cache@v1 + with: + path: tests + key: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec-${{ github.sha }} + restore-keys: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec- + - name: Run brew tests run: | # brew tests doesn't like world writable directories @@ -283,6 +293,16 @@ jobs: which svn which svnadmin + - name: Create parallel test log directory + run: mkdir tests + + - name: Cache parallel tests log + uses: actions/cache@v1 + with: + path: tests + key: ${{ runner.os }}-parallel_runtime_rspec-${{ github.sha }} + restore-keys: ${{ runner.os }}-parallel_runtime_rspec- + - name: Run brew tests run: brew tests --online --coverage env: diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 259f7a45c7..4900b0ef8d 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -98,10 +98,23 @@ module Homebrew Dir.glob("test/**/*_spec.rb") end + parallel_rspec_log_name = "parallel_runtime_rspec" + parallel_rspec_log_name = "#{parallel_rspec_log_name}.no_compat" if args.no_compat? + parallel_rspec_log_name = "#{parallel_rspec_log_name}.generic" if args.generic? + parallel_rspec_log_name = "#{parallel_rspec_log_name}.online" if args.online? + parallel_rspec_log_name = "#{parallel_rspec_log_name}.log" + + parallel_rspec_log_path = if ENV["CI"] + "tests/#{parallel_rspec_log_name}" + else + "#{HOMEBREW_CACHE}/#{parallel_rspec_log_name}" + end + parallel_args = if ENV["CI"] - %w[ + %W[ --combine-stderr --serialize-stdout + --runtime-log "#{parallel_rspec_log_path}" ] else %w[ @@ -120,7 +133,7 @@ module Homebrew --require spec_helper --format NoSeedProgressFormatter --format ParallelTests::RSpec::RuntimeLogger - --out #{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log + --out #{parallel_rspec_log_path} ] bundle_args << "--format" << "RSpec::Github::Formatter" if ENV["GITHUB_ACTIONS"]