beads/tools
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
..
bazel ci: fix red nightly (Bazel-skip allowlist, credential helper init); rerun-safe Bazel artifacts (#7096) 2026-10-02 05:42:05 -07:00
docsmint build(bazel): side-by-side Bazel scaffold + policy tests (#6798) 2026-09-27 03:41:02 -07:00