ci(bazel): never cache embedded-tier test results

Review F2. Since D2 step 1 the Bazel embedded lane is the tier's only
pre-merge run on same-repo PRs, so a cached PASS (stale, or a poisoned
entry in the shared farm action cache) or a cached run that never
re-exercises an intermittent -race finding would stand in for the legacy
jobs' -test.count=1 run. test:embedded now sets --nocache_test_results,
and the policy test requires it and forbids any other rc line that turns
test result caching back on.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gas City Adopt-PR 2026-10-01 06:19:33 +00:00
commit f4df4e4bf3
2 changed files with 15 additions and 0 deletions

View file

@ -99,6 +99,12 @@ test:embedded --test_timeout=-1,-1,-1,1200
test:embedded --test_arg=-test.parallel=4
test:embedded --test_env=GO_TEST_WRAP_TESTV=1
test:embedded --remote_download_regex=.*/test\.xml$
# Since D2 step 1 this lane is the tier's only pre-merge run on same-repo PRs
# (pr-risk.yml's legacy jobs stand down), and the legacy jobs ran every test
# every time (-test.count=1). A cached PASS would let a stale or poisoned
# farm action-cache entry, or an unreproduced -race finding, stand in for a
# run: always execute, at farm (not runner) cost.
test:embedded --nocache_test_results
# Dolt-server lane: the same jobs as the docker lane ("Test (storage domain +
# uow)" and "Contract corpus"), but every dolt sql-server is a child of the

View file

@ -3378,12 +3378,21 @@ func TestBazelEmbeddedJobMirrorsEmbeddedTier(t *testing.T) {
"test:embedded --test_tag_filters=embedded",
// The jobs pass no -parallel: GOMAXPROCS on 4-vCPU ubuntu-latest.
"test:embedded --test_arg=-test.parallel=4",
// The tier's only pre-merge run (D2 step 1) must execute, like the
// legacy jobs' -test.count=1, never replay a cached result.
"test:embedded --nocache_test_results",
} {
if !rc[want] {
t.Errorf(".bazelrc lacks %q", want)
}
}
for line := range rc {
// Nothing turns result caching back on for the embedded lane (a
// later --cache_test_results wins over --nocache_test_results).
if !strings.HasPrefix(line, "#") && strings.Contains(line, "cache_test_results") &&
line != "test:embedded --nocache_test_results" && line != "test:docker --nocache_test_results" {
t.Errorf(".bazelrc %q: only test:embedded and test:docker set test result caching", line)
}
if strings.HasPrefix(line, "test:embedded ") && (strings.Contains(line, "-test.short") || strings.Contains(line, "BEADS_TEST_SKIP")) {
t.Errorf(".bazelrc %q: the embedded jobs run without -short and BEADS_TEST_SKIP", line)
}