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 01/10] 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"] From 7f5a97d1f3674c889d2d62c03e5b4e558d2ad771 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 1 Apr 2021 23:28:33 +0900 Subject: [PATCH 02/10] change directory for log --- .github/workflows/tests.yml | 2 +- Library/Homebrew/dev-cmd/tests.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32a37785ad..30e606190a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -204,7 +204,7 @@ jobs: - name: Cache parallel tests log uses: actions/cache@v1 with: - path: /tests/parallel_runtime_rspec.log + path: /tmp/parallel_runtime_rspec.log key: ${{ runner.os }}-parallel_runtime_rspec-${{ hashFiles('**/parallel_runtime_rspec.log') }} restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 37a92cd54f..b52f9e3fa9 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -99,7 +99,7 @@ module Homebrew end parallel_rspec_log_path =if ENV["CI"] - "/tests/parallel_runtime_rspec.log" + "/tmp/parallel_runtime_rspec.log" else "#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log" end From 603c607d588fcca240226241dcdd3af02feb7f5c Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 1 Apr 2021 23:54:30 +0900 Subject: [PATCH 03/10] change order of caching test log --- .github/workflows/tests.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 30e606190a..8121a1bedf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,13 +201,6 @@ jobs: - name: Install Bundler RubyGems run: brew install-bundler-gems - - name: Cache parallel tests log - uses: actions/cache@v1 - with: - path: /tmp/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 @@ -219,6 +212,13 @@ jobs: - uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1 + - name: Cache parallel tests log + uses: actions/cache@v1 + with: + path: /tmp/parallel_runtime_rspec.log + key: ${{ runner.os }}-parallel_runtime_rspec-${{ hashFiles('**/parallel_runtime_rspec.log') }} + restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log + test-default-formula-linux: name: test default formula (Linux) runs-on: ubuntu-latest From c0dc5cae68a63847bd1c2e915db99137c4470f38 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Fri, 2 Apr 2021 00:25:33 +0900 Subject: [PATCH 04/10] repair cache key --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8121a1bedf..5acf728689 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -216,7 +216,7 @@ jobs: uses: actions/cache@v1 with: path: /tmp/parallel_runtime_rspec.log - key: ${{ runner.os }}-parallel_runtime_rspec-${{ hashFiles('**/parallel_runtime_rspec.log') }} + key: ${{ runner.os }}-parallel_runtime_rspec.log restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log test-default-formula-linux: From 854b898856bf6ec6bdb4c869bf8b77d82f95292f Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Fri, 2 Apr 2021 21:00:27 +0900 Subject: [PATCH 05/10] change test log path --- .github/workflows/tests.yml | 2 +- Library/Homebrew/dev-cmd/tests.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5acf728689..ce0d712307 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -215,7 +215,7 @@ jobs: - name: Cache parallel tests log uses: actions/cache@v1 with: - path: /tmp/parallel_runtime_rspec.log + path: parallel_runtime_rspec.log key: ${{ runner.os }}-parallel_runtime_rspec.log restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index b52f9e3fa9..06981975a9 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -99,7 +99,7 @@ module Homebrew end parallel_rspec_log_path =if ENV["CI"] - "/tmp/parallel_runtime_rspec.log" + "parallel_runtime_rspec.log" else "#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log" end From 7fbe08e857b46402f57b1eefa92f7f52cfb92276 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Sat, 3 Apr 2021 19:03:35 +0900 Subject: [PATCH 06/10] add a directory for test log --- .github/workflows/tests.yml | 5 ++++- Library/Homebrew/dev-cmd/tests.rb | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ce0d712307..56d0cc5419 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,6 +201,9 @@ jobs: - name: Install Bundler RubyGems run: brew install-bundler-gems + - name: Create parallel test log + run: mkdir tests + - name: Run brew tests run: | # brew tests doesn't like world writable directories @@ -215,7 +218,7 @@ jobs: - name: Cache parallel tests log uses: actions/cache@v1 with: - path: parallel_runtime_rspec.log + path: tests/parallel_runtime_rspec.log key: ${{ runner.os }}-parallel_runtime_rspec.log restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 06981975a9..5ee0020937 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -98,8 +98,8 @@ module Homebrew Dir.glob("test/**/*_spec.rb") end - parallel_rspec_log_path =if ENV["CI"] - "parallel_runtime_rspec.log" + parallel_rspec_log_path = if ENV["CI"] + "tests/parallel_runtime_rspec.log" else "#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log" end From 5366bc197c5480ca2453de33624becb9207127c8 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Mon, 5 Apr 2021 22:39:15 +0900 Subject: [PATCH 07/10] repair tests order --- .github/workflows/tests.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 56d0cc5419..864621e2ec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -201,9 +201,16 @@ jobs: - name: Install Bundler RubyGems run: brew install-bundler-gems - - name: Create parallel test log + - name: Create parallel test log directory run: mkdir tests + - name: Cache parallel tests log + uses: actions/cache@v1 + with: + path: tests/parallel_runtime_rspec.log + key: ${{ runner.os }}-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 @@ -215,13 +222,6 @@ jobs: - uses: codecov/codecov-action@e156083f13aff6830c92fc5faa23505779fbf649 # v1.2.1 - - name: Cache parallel tests log - uses: actions/cache@v1 - with: - path: tests/parallel_runtime_rspec.log - key: ${{ runner.os }}-parallel_runtime_rspec.log - restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log - test-default-formula-linux: name: test default formula (Linux) runs-on: ubuntu-latest @@ -293,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/parallel_runtime_rspec.log + key: ${{ runner.os }}-parallel_runtime_rspec.log + restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log + - name: Run brew tests run: brew tests --online --coverage env: From 3c308aa031c81443f086a4f0ffb187ecbbefb175 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Tue, 6 Apr 2021 09:38:37 +0900 Subject: [PATCH 08/10] create different tests log with each options --- .github/workflows/tests.yml | 8 +++----- Library/Homebrew/dev-cmd/tests.rb | 10 ++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 864621e2ec..1e58b9b52a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -207,9 +207,8 @@ jobs: - name: Cache parallel tests log uses: actions/cache@v1 with: - path: tests/parallel_runtime_rspec.log - key: ${{ runner.os }}-parallel_runtime_rspec.log - restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log + path: tests + key: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec - name: Run brew tests run: | @@ -299,9 +298,8 @@ jobs: - name: Cache parallel tests log uses: actions/cache@v1 with: - path: tests/parallel_runtime_rspec.log + path: tests key: ${{ runner.os }}-parallel_runtime_rspec.log - restore-keys: ${{ runner.os }}-parallel_runtime_rspec.log - name: Run brew tests run: brew tests --online --coverage diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 5ee0020937..4900b0ef8d 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -98,10 +98,16 @@ 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_runtime_rspec.log" + "tests/#{parallel_rspec_log_name}" else - "#{HOMEBREW_CACHE}/tests/parallel_runtime_rspec.log" + "#{HOMEBREW_CACHE}/#{parallel_rspec_log_name}" end parallel_args = if ENV["CI"] From 9476ba2d2f1dd60082e0a708f5683f678557e733 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Tue, 6 Apr 2021 23:01:42 +0900 Subject: [PATCH 09/10] repair cache key and add restore key --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1e58b9b52a..0b71231972 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -208,7 +208,8 @@ jobs: uses: actions/cache@v1 with: path: tests - key: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec + 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: | @@ -299,7 +300,8 @@ jobs: uses: actions/cache@v1 with: path: tests - key: ${{ runner.os }}-parallel_runtime_rspec.log + key: ${{ runner.os }}-parallel_runtime_rspec-${{ github.sha }} + restore-keys: ${{ runner.os }}-parallel_runtime_rspec - name: Run brew tests run: brew tests --online --coverage From 7f3ad670583cecb833118b4ee42dde8ba762ec10 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Thu, 8 Apr 2021 09:43:50 +0900 Subject: [PATCH 10/10] repair restore key --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0b71231972..0dd005aba9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -209,7 +209,7 @@ jobs: with: path: tests key: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec-${{ github.sha }} - restore-keys: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec + restore-keys: ${{ runner.os }}-${{ matrix.test-flags }}-parallel_runtime_rspec- - name: Run brew tests run: | @@ -301,7 +301,7 @@ jobs: with: path: tests key: ${{ runner.os }}-parallel_runtime_rspec-${{ github.sha }} - restore-keys: ${{ runner.os }}-parallel_runtime_rspec + restore-keys: ${{ runner.os }}-parallel_runtime_rspec- - name: Run brew tests run: brew tests --online --coverage