From d490e2a9a794393d7c706f8273d3121cf1f402a6 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 30 Jun 2021 08:41:19 +0100 Subject: [PATCH] Fix BuildPulse handling - be more verbose with output to be clear when we're using/submitting to BuildPulse - remove the duplicate BuildPulse submission step --- .github/workflows/tests.yml | 11 ----------- Library/Homebrew/dev-cmd/tests.rb | 13 ++++++++++--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 732b515ce6..af9a27663b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index b372914455..63f8d4dc2e 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -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