beads/internal/testutil
Julian Knutsen fe6bd6301f
ci: fix red nightly (Bazel-skip allowlist, credential helper init); rerun-safe Bazel artifacts (#7096)
* fix(ci): allowlist the scripts tests that skip under Bazel, and check new ones before merge

nightly.yml's skip-parity check (equivalence.py --go-test-json) went red
on 2026-10-02 (run 36955306415): TestBazelGatedLanesNeverRetryFlakyTests
and TestCheckShardCoverageScript pass under go test and deliberately
t.Skip under Bazel (their inputs are not in //scripts:scripts_test's
runfiles), but had no `skip` allowlist entry. Step 2's
TestShardScriptsListOnlyRealTests and TestShardScriptNarrowingCheck, now
on main, have the same shape and would have turned the next nightly red.

Add the four entries, and TestBazelOnlySkipsAreAllowlisted: it parses
every _test.go file of the module and requires each top-level test whose
t.Skip is guarded by TEST_SRCDIR or bazeltest.IsBazel() (directly or
through a helper) to have an entry, so a new one fails under go test
before the merge instead of in the next nightly. It skips under Bazel
itself and is allowlisted too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(test): keep cmd/bd's integration init out of the credential-command helper process

nightly.yml's Full Test Suite (go test -tags=integration ./...) failed
TestApplyInitGatewayCredentialAdoptsToken and ...FailsClosed on
2026-10-02 (run 36955306415): credentialcmd re-execs the test binary as
the credential helper, and cli_fast_test.go's integration-tagged init()
runs in that child before TestMain can dispatch it, tries `go build .`
from the helper's working directory and panics, so the helper exits 2.
Add credentialcmd.IsHelperProcess (Dispatch's two gates) and return from
that init early, as it already does for the worktree-remove helper.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(bazel): overwrite fixed-name artifacts so "Re-run failed jobs" does not 409

A job re-run is the same workflow run, and upload-artifact v4+ refuses a
second artifact of the same name there (409 Conflict). bazel-test uploads
the bd package even after its tests fail, so re-running a failed Bazel /
test lane, the documented recovery for an eviction or a flake, failed on
the upload even when every test passed. Set overwrite: true on all eight
uploads in bazel.yml (the bd package, BUILD sync patch, every lane's test
logs) and policy-test it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(test): keep skip-scan fixture functions out of line-based test discovery

The fixture source in bazel_skip_allowlist_test.go had top-level
`func TestXxx(t *testing.T)` lines, which equivalence.py (and the CI shard
scripts) count as tests of the scripts package; write them with a FUNC
placeholder and substitute at write time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 05:42:05 -07:00
..
bazeltest test(bazel): hermetic test env + inject bd binary into subprocess tests (#6843) 2026-09-27 11:38:03 -07:00
credentialcmd ci: fix red nightly (Bazel-skip allowlist, credential helper init); rerun-safe Bazel artifacts (#7096) 2026-10-02 05:42:05 -07:00
fixtures build(bazel): integration-tag lane (--config=integration) matching main.yml (#6916) 2026-09-28 14:11:34 -07:00
integration ci(bazel): server-Dolt storage and proxied tiers on remote execution (#6940) 2026-09-28 23:01:40 -07:00
testdata testutil: migrate test Dolt server from binary-spawning to testcontainers 2026-02-28 21:12:41 -08:00
BUILD.bazel Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
container_provider.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
container_provider_windows.go /{cmd,internal}: some cleanup 2026-04-08 14:45:18 -07:00
dockercontext.go fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos) (#5391) 2026-08-07 00:32:40 -07:00
dockercontext_test.go fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos) (#5391) 2026-08-07 00:32:40 -07:00
git_test_hooks.go Test isolation follow-up: consolidate and guard hooksPath leakage (#2234) (#2237) 2026-03-01 14:41:08 -08:00
gm2g3g5r_failopen_test.go Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
gm2g3g5r_failopen_unix_test.go Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
gm2g3g5r_failopen_windows_test.go Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
localdoltserver.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
localdoltserver_linux.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
localdoltserver_other.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
localdoltserver_test.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
suite_temp.go fix(doltserver): recognize GOTMPDIR as a temp-dir sweep root (Go 1.26+) (#6733) 2026-09-26 04:30:59 -07:00
suite_temp_test.go fix(doctor): reap leaked test dolt sql-servers from CGO_ENABLED=0 suites (#5917) 2026-09-02 18:11:33 -07:00
testdoltbranch.go fix(testutil): wait for database visibility in SetupSharedTestDB (#5788) 2026-09-29 17:22:06 -07:00
testdoltbranch_test.go fix(testutil): wait for database visibility in SetupSharedTestDB (#5788) 2026-09-29 17:22:06 -07:00
testdoltcommon.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
testdoltserver.go Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
testdoltserver_env_test.go test(testutil): opt-in local dolt sql-server backend for Dolt-backed tests (#6891) 2026-09-28 04:06:49 -07:00
testdoltserver_unreachable_test.go fix(test): recover when a Dolt test server dies mid-suite (#6756) 2026-09-26 14:27:18 -07:00
testdoltserver_windows.go Fix: test suites fail closed instead of open on the ambient Dolt port when no test container is started (be-napos) (#5885) 2026-10-01 05:21:49 -07:00
tmpfs.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00
tmpfs_test.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00