From 0ebc90ee6710a25ec5394571d09620b6aaf649b6 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 1 Apr 2021 23:15:51 +0900 Subject: [PATCH] cache paralell tests log on ci --- .github/workflows/tests.yml | 7 +++++++ Library/Homebrew/dev-cmd/tests.rb | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02753e2680..32a37785ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,6 +201,13 @@ jobs: - name: Install Bundler RubyGems run: brew install-bundler-gems + - name: Cache parallel tests log + uses: actions/cache@v1 + with: + path: /tests/parallel_runtime_rspec.log + key: ${{ runner.os }}-parallel_runtime_rspec-${{ hashFiles('**/parallel_runtime_rspec.log') }} + restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log + - name: Run brew tests run: | # brew tests doesn't like world writable directories diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 259f7a45c7..37a92cd54f 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -98,10 +98,17 @@ module Homebrew Dir.glob("test/**/*_spec.rb") end + parallel_rspec_log_path =if ENV["CI"] + "/tests/parallel_runtime_rspec.log" + else + "#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log" + end + parallel_args = if ENV["CI"] - %w[ + %W[ --combine-stderr --serialize-stdout + --runtime-log "#{parallel_rspec_log_path}" ] else %w[ @@ -120,7 +127,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"]