-
-
Notifications
You must be signed in to change notification settings - Fork 652
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print reduced
pants test ...
command to rerun, when on CI (#20747)
This augments the existing test summary output to show an appropriate invocation for rerunning any failed tests. This is controlled by the new `[test].show_rerun_command` option, which defaults to: - off for "local" dev: since just rerunning the exact same command will generally already only rerun the failures, due to caching - on in CI: since people often won't be sharing a cache with the CI machines, so rerunning some bulk `pants test ::` command may need to chug through all the successful tests too For instance, given three tests, where two fail: ``` ✓ //:good-but-slow succeeded in 123.00s (run locally). ✕ //:bad1 failed in 2.00s (run locally). ✕ path/to:bad2 failed in 3.00s (run locally). To rerun the failing tests, use: pants test //:bad1 path/to:bad2 ``` If this appears in CI a dev can copy and paste that invocation to just those two bad tests locally, without having to spend time running `//:good-but-slow`. Currently, without this suggested invocation, the dev would have to copy and paste each target line from the individual summary lines. With a lot of failures, the line might be very long, but I think that's okay: it should still be copy-paste-able just fine. Potentially it'd be good to do this for other goals too (e.g. after `pants fix ::`, `To fix the problematic files, try: pants fix ...`), but I'm not sure we have a generic infrastructure that would make this easy, and usually those goals will be faster than tests.
- Loading branch information
Showing
2 changed files
with
168 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters