Merge pull request #14857 from Homebrew/buildpulse

dev-cmd/tests: better output for BuildPulse failures
This commit is contained in:
Bo Anderson 2023-03-01 22:38:25 +00:00 committed by GitHub
commit 10dd6a30ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,11 +62,13 @@ module Homebrew
ohai "Sending test results to BuildPulse" ohai "Sending test results to BuildPulse"
result = quiet_system Formula["buildpulse-test-reporter"].opt_bin/"buildpulse-test-reporter", # TODO: make this use `system_command!` when https://github.com/buildpulse/buildpulse-action/issues/4 is fixed
"submit", "#{HOMEBREW_LIBRARY_PATH}/test/junit", system_command Formula["buildpulse-test-reporter"].opt_bin/"buildpulse-test-reporter",
"--account-id", ENV.fetch("HOMEBREW_BUILDPULSE_ACCOUNT_ID"), args: [
"--repository-id", ENV.fetch("HOMEBREW_BUILDPULSE_REPOSITORY_ID") "submit", "#{HOMEBREW_LIBRARY_PATH}/test/junit",
odie "Failed to send test results to BuildPulse!" unless result "--account-id", ENV.fetch("HOMEBREW_BUILDPULSE_ACCOUNT_ID"),
"--repository-id", ENV.fetch("HOMEBREW_BUILDPULSE_REPOSITORY_ID")
]
end end
def changed_test_files def changed_test_files
@ -191,10 +193,11 @@ module Homebrew
else else
system "bundle", "exec", "rspec", *bundle_args, "--", *files system "bundle", "exec", "rspec", *bundle_args, "--", *files
end end
success = $CHILD_STATUS.success?
run_buildpulse if use_buildpulse? run_buildpulse if use_buildpulse?
return if $CHILD_STATUS.success? return if success
Homebrew.failed = true Homebrew.failed = true
end end