Merge pull request #10989 from hyuraku/paralell_tests_cache_on_ci

cache parallel tests log on ci
This commit is contained in:
Mike McQuaid 2021-04-08 08:46:19 +01:00 committed by GitHub
commit 55223555ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 2 deletions

View File

@ -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:

View File

@ -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"]