dev-cmd/test: set RUST_BACKTRACE when retrying

Occasionally, a new version of Rust will cause failures in dependents.
See, for example, Homebrew/homebrew-core#107818.

This change will allow us to get a fuller backtrace in CI, which will
also make it easier to submit bug reports upstream.

Without this change, recovering a full backtrace requires installing the
new version of Rust and rebuilding the failing formula from source. Both
these steps can be skipped if we set `RUST_BACKTRACE` when retrying a
failing test.
This commit is contained in:
Carlo Cabrera 2022-08-15 18:27:32 +08:00
parent 00fd810529
commit a1c1bf73ec
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -119,6 +119,7 @@ module Homebrew
if args.retry? && @test_failed.add?(f)
oh1 "Testing #{f.full_name} (again)"
f.clear_cache
ENV["RUST_BACKTRACE"] = "full"
true
else
Homebrew.failed = true