Fix BuildPulse handling

- be more verbose with output to be clear when we're using/submitting to
  BuildPulse
- remove the duplicate BuildPulse submission step
This commit is contained in:
Mike McQuaid 2021-06-30 08:41:19 +01:00
parent 1680ddb267
commit d490e2a9a7
No known key found for this signature in database
GPG Key ID: 3338A31AFDB1D829
2 changed files with 10 additions and 14 deletions

View File

@ -333,14 +333,3 @@ jobs:
- run: brew test-bot --only-formulae --test-default-formula
- uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192
- name: Upload test results to BuildPulse for flaky test detection
# Only run this step for non-PR pushes or PRs where where we have access to secrets.
# Run this step even when the tests fail. Skip if the workflow is cancelled.
if: (github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled()
env:
BUILDPULSE_ACCESS_KEY_ID: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
BUILDPULSE_SECRET_ACCESS_KEY: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
run: |
brew install buildpulse-test-reporter
buildpulse-test-reporter submit Library/Homebrew/test/junit --account-id 1503512 --repository-id 53238813

View File

@ -50,14 +50,18 @@ module Homebrew
unless Formula["buildpulse-test-reporter"].any_version_installed?
ohai "Installing `buildpulse-test-reporter` for reporting test flakiness..."
safe_system HOMEBREW_BREW_FILE, "install", "buildpulse-test-reporter"
with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
safe_system HOMEBREW_BREW_FILE, "install", "buildpulse-test-reporter"
end
end
ENV["BUILDPULSE_ACCESS_KEY_ID"] = ENV["HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"]
ENV["BUILDPULSE_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_BUILDPULSE_SECRET_ACCESS_KEY"]
ohai "Sending test results to BuildPulse"
safe_system Formula["buildpulse-test-reporter"].opt_bin/"buildpulse-test-reporter",
"submit", "Library/Homebrew/test/junit",
"submit", "#{HOMEBREW_LIBRARY_PATH}/test/junit",
"--account-id", ENV["HOMEBREW_BUILDPULSE_ACCOUNT_ID"],
"--repository-id", ENV["HOMEBREW_BUILDPULSE_REPOSITORY_ID"]
end
@ -182,7 +186,10 @@ module Homebrew
# Submit test flakiness information using BuildPulse
# BUILDPULSE used in spec_helper.rb
ENV["BUILDPULSE"] = "1" if use_buildpulse?
if use_buildpulse?
ENV["BUILDPULSE"] = "1"
ohai "Running tests with BuildPulse-friendly settings"
end
if parallel
system "bundle", "exec", "parallel_rspec", *parallel_args, "--", *bundle_args, "--", *files