Skip to content

Commit 64f6785

Browse files
authored
Avoid analysis cache drop when switching between build and test (#9467)
`--test_env` is still a `build` option in Bazel 8 (fixed in bazelbuild/bazel@43ebb95) and thus invalidates the analysis cache when it changes between `build` and `test`. Since that's obscure knowledge and there is no downside, migrate all test options to `common`.
1 parent f317628 commit 64f6785

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ common:target-linux-arm64 --config=workspace-target-linux-arm64
4040
#
4141
# Don't run benchmarks by default; benchmarks should only run if we are
4242
# explicitly doing performance testing.
43-
test --test_tag_filters=-docker,-bare,-secrets,-performance
43+
common --test_tag_filters=-docker,-bare,-secrets,-performance
4444

4545
# CI invocations from public repo should be publicly accessible.
4646
common:ci-shared --build_metadata=VISIBILITY=PUBLIC

shared.bazelrc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig
6363
# Add `-test.v` to all Go tests so that each test func is reported as a separate test case
6464
# in the XML output. This allows our webUI to display the run time of each test case
6565
# separately and let us know which tests is slow.
66-
test --test_env=GO_TEST_WRAP_TESTV=1
66+
common --test_env=GO_TEST_WRAP_TESTV=1
6767

6868
# In rules_go v0.50.0, nogo static analysis was moved from GoCompilePkg to a couple of
6969
# actions: RunNogo and ValidateNogo. Among these, ValidateNogo is a validation action*.
@@ -79,34 +79,34 @@ common --experimental_use_validation_aspect=true
7979
# Don't show cached test results in the test summary
8080
# We have many tests that can fill up the console with cached results.
8181
# If you prefer to see cached results, set this to 'short' in user.bazelrc file.
82-
test --test_summary=terse
82+
common --test_summary=terse
8383

8484
common:race --@io_bazel_rules_go//go/config:race
8585

8686
common:performance --compilation_mode=opt
8787

8888
# Configurations used to debug flaky tests
8989
common:quarantine --config=remote-minimal
90-
test:quarantine --config=race
91-
test:quarantine --test_env=RUN_QUARANTINED_TESTS=true
90+
common:quarantine --config=race
91+
common:quarantine --test_env=RUN_QUARANTINED_TESTS=true
9292

9393
# Configuration used to deflake tests
9494
common:deflake --config=remote-minimal
95-
test:deflake --runs_per_test=100
96-
test:deflake --test_output=errors
97-
test:deflake --test_runner_fail_fast
98-
test:deflake --notest_keep_going
99-
test:deflake --config=quarantine
95+
common:deflake --runs_per_test=100
96+
common:deflake --test_output=errors
97+
common:deflake --test_runner_fail_fast
98+
common:deflake --notest_keep_going
99+
common:deflake --config=quarantine
100100

101101
# Run Webdriver tests with --config=webdriver-debug to debug webdriver tests locally.
102102
# See server/testutil/webtester/webtester.go for more details.
103-
test:webdriver-debug --test_arg=-webdriver_headless=false
104-
test:webdriver-debug --test_arg=-webdriver_end_of_test_delay=3s
103+
common:webdriver-debug --test_arg=-webdriver_headless=false
104+
common:webdriver-debug --test_arg=-webdriver_end_of_test_delay=3s
105105
# Forward X server display for local webdriver tests.
106-
test:webdriver-debug --test_env=DISPLAY
106+
common:webdriver-debug --test_env=DISPLAY
107107
# When debugging, only run one webdriver test at a time (it's overwhelming
108108
# otherwise).
109-
test:webdriver-debug --local_test_jobs=1
109+
common:webdriver-debug --local_test_jobs=1
110110

111111

112112
###################################

0 commit comments

Comments
 (0)