Skip to content

Commit d490e2a

Browse files
committed
Fix BuildPulse handling
- be more verbose with output to be clear when we're using/submitting to BuildPulse - remove the duplicate BuildPulse submission step
1 parent 1680ddb commit d490e2a

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,3 @@ jobs:
333333
- run: brew test-bot --only-formulae --test-default-formula
334334

335335
- uses: codecov/codecov-action@29386c70ef20e286228c72b668a06fd0e8399192
336-
337-
- name: Upload test results to BuildPulse for flaky test detection
338-
# Only run this step for non-PR pushes or PRs where where we have access to secrets.
339-
# Run this step even when the tests fail. Skip if the workflow is cancelled.
340-
if: (github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository) && !cancelled()
341-
env:
342-
BUILDPULSE_ACCESS_KEY_ID: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
343-
BUILDPULSE_SECRET_ACCESS_KEY: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
344-
run: |
345-
brew install buildpulse-test-reporter
346-
buildpulse-test-reporter submit Library/Homebrew/test/junit --account-id 1503512 --repository-id 53238813

Library/Homebrew/dev-cmd/tests.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ def run_buildpulse
5050

5151
unless Formula["buildpulse-test-reporter"].any_version_installed?
5252
ohai "Installing `buildpulse-test-reporter` for reporting test flakiness..."
53-
safe_system HOMEBREW_BREW_FILE, "install", "buildpulse-test-reporter"
53+
with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
54+
safe_system HOMEBREW_BREW_FILE, "install", "buildpulse-test-reporter"
55+
end
5456
end
5557

5658
ENV["BUILDPULSE_ACCESS_KEY_ID"] = ENV["HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"]
5759
ENV["BUILDPULSE_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_BUILDPULSE_SECRET_ACCESS_KEY"]
5860

61+
ohai "Sending test results to BuildPulse"
62+
5963
safe_system Formula["buildpulse-test-reporter"].opt_bin/"buildpulse-test-reporter",
60-
"submit", "Library/Homebrew/test/junit",
64+
"submit", "#{HOMEBREW_LIBRARY_PATH}/test/junit",
6165
"--account-id", ENV["HOMEBREW_BUILDPULSE_ACCOUNT_ID"],
6266
"--repository-id", ENV["HOMEBREW_BUILDPULSE_REPOSITORY_ID"]
6367
end
@@ -182,7 +186,10 @@ def tests
182186

183187
# Submit test flakiness information using BuildPulse
184188
# BUILDPULSE used in spec_helper.rb
185-
ENV["BUILDPULSE"] = "1" if use_buildpulse?
189+
if use_buildpulse?
190+
ENV["BUILDPULSE"] = "1"
191+
ohai "Running tests with BuildPulse-friendly settings"
192+
end
186193

187194
if parallel
188195
system "bundle", "exec", "parallel_rspec", *parallel_args, "--", *bundle_args, "--", *files

0 commit comments

Comments
 (0)