Add short_uncached and detailed_uncached options to --test_summary#28290
Add short_uncached and detailed_uncached options to --test_summary#28290Silic0nS0ldier wants to merge 3 commits intobazelbuild:masterfrom
short_uncached and detailed_uncached options to --test_summary#28290Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces short_uncached and detailed_uncached options for --test_summary to exclude cached test results, which is a useful feature. The implementation is solid, and I particularly appreciate the refactoring in TerminalTestResultNotifier to use EnumSets for clarity and the significant improvements to TerminalTestResultNotifierTest for better test isolation and readability. The new shell tests are also a great addition. I've left a couple of suggestions to improve the new unit tests to make them more robust.
src/test/java/com/google/devtools/build/lib/runtime/TerminalTestResultNotifierTest.java
Show resolved
Hide resolved
|
Motivation for this change is to better support using Excessively large output means more scrolling and in the case of Buildkite, can result in the top of logs being cutoff due to 2MB limit for terminal rendering (there is a separate log-only page with a higher limit). |
short_uncached and detailed_uncached options to --test_summaryshort_uncached and detailed_uncached options to --test_summary
|
I would love this change! It would be nice to get into 8.6 as well if possible. |
|
|
||
| private void printFailedToBuildSummaries() throws LabelSyntaxException { | ||
| // A record that is used to generate a TestSummary mock object for testing. | ||
| private static record TestSummarySpec( |
There was a problem hiding this comment.
Consider using a builder pattern (basically promoting comments from above to actual methods)
There was a problem hiding this comment.
Refactored. It's a shame records don't implement this kind of pattern (or something similar like named arguments).
a91854e to
31516c5
Compare
|
@Silic0nS0ldier How easy would this be to get into 8.x and 9.0? |
|
I don't think much has changed in the areas touched across theose versions, so backporting should be easy. |
|
@meisterT Any reservations about backporting this to v9 and v8.6? |
|
No reservations, please go ahead and assign me as reviewer |
|
@bazel-io fork 9.0.0 |
|
Yeah, I figured that required maintainer permission minimum. I'll get it done manually. |
…ry` (bazelbuild#28290) These options exclude cached test results from the summary. With `short` (default) ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.770s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (cached) PASSED in 2.8s Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` With `short_uncached` ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed --test_summary=short_uncached INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.264s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` Resolves bazelbuild#28062 RELNOTES: Reporting of cached test results can now be suppressed with `--test_summary=short_uncached` or `--test_summary=detailed_uncached`. Closes bazelbuild#28290. PiperOrigin-RevId: 857282700 Change-Id: Iaea823462344a6118bd5a112d734df5c35a1e152
…ry` (bazelbuild#28290) These options exclude cached test results from the summary. With `short` (default) ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.770s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (cached) PASSED in 2.8s Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` With `short_uncached` ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed --test_summary=short_uncached INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.264s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` Resolves bazelbuild#28062 RELNOTES: Reporting of cached test results can now be suppressed with `--test_summary=short_uncached` or `--test_summary=detailed_uncached`. Closes bazelbuild#28290. PiperOrigin-RevId: 857282700 Change-Id: Iaea823462344a6118bd5a112d734df5c35a1e152
|
@meisterT PRs raised, but I lack the permission necessary to assign you as a reviewer. |
…st_summary` (#28343) These options exclude cached test results from the summary. With `short` (default) ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.770s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (cached) PASSED in 2.8s Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` With `short_uncached` ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed --test_summary=short_uncached INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.264s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` Resolves #28062 RELNOTES: Reporting of cached test results can now be suppressed with `--test_summary=short_uncached` or `--test_summary=detailed_uncached`. Backport of #28290.
…st_summary` (#28341) These options exclude cached test results from the summary. With `short` (default) ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.770s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (cached) PASSED in 2.8s Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` With `short_uncached` ``` vscode ➜ /workspaces/bazel/bazel (uncached-test-summary-options) $ bazel-bin/src/bazel test //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests --test_filter=shortUncachedOption_allPassed --test_summary=short_uncached INFO: Analyzed target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests (0 packages loaded, 0 targets configured). INFO: Found 1 test target... Target //src/test/java/com/google/devtools/build/lib/runtime:RuntimeTests up-to-date: bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests bazel-bin/src/test/java/com/google/devtools/build/lib/runtime/RuntimeTests.jar INFO: Elapsed time: 0.264s, Critical Path: 0.00s INFO: 1 process: 1 action cache hit, 1 internal. INFO: Build completed successfully, 1 total action Executed 0 out of 1 test: 1 test passes. There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are. ``` Resolves #28062 RELNOTES: Reporting of cached test results can now be suppressed with `--test_summary=short_uncached` or `--test_summary=detailed_uncached`. Backport of #28290.
These options exclude cached test results from the summary.
With
short(default)With
short_uncachedResolves #28062
RELNOTES: Reporting of cached test results can now be suppressed with
--test_summary=short_uncachedor--test_summary=detailed_uncached.