beads/scripts/ci
ecuthiell 61865bb0fe
test(init): make gateway credential fixtures portable across native shells (#5715) (#5725)
* test(init): make gateway credential fixture portable (#5715)

Replace shell-specific fixture commands with an opt-in test helper, exercise exact credential semantics under a restricted shell PATH without copied Windows PE fixtures, and require the focused suite in native Windows PR CI.

Agent-Signature: Codex-unknown-model-unknown-reasoning on behalf of Ewen Cuthiell

* test(init): keep the original shell across native credential fixtures

Use a symlink to the original Unix shell so macOS AMFI does not reject a
copied system executable. Keep Windows cmd.exe and the test image in place,
internalize helper environment names and assert the typed helper exit code.

Run the six fixture cases through one Bash3.2-compatible driver in the
existing required three-host preflight matrix. Preserve the liveness check
name and optional macOS suite policy; reject missing or skipped execution.

Review: https://github.com/gastownhall/beads/pull/5725#pullrequestreview-5096996756
Bead: saa-cgh.47
Agent-Signature: unknown-model/unknown-reasoning

* test(ci): sync-check the native fixture list and stop forcing a second build graph

Maintainer review fixes for PR #5725, adoption iteration 1. The synthesis is
`approve` with no required changes; all findings are minor or nit. The rebase
lane had to repair this branch (`repaired_clean`, and the original head still
conflicts with main), so there is no accepted-as-is path and finalize owes a
push either way — these cost nothing extra.

Test evidence (minor): the `expected` array is, by its own comment, the single
list owning both test selection and required execution evidence -- but nothing
tied it back to the source file. A seventh TestApplyInitGatewayCredential*
fixture added later would fall out of the `-run` selector, lose native
macOS/Windows execution entirely, and still leave the driver exiting 0 with the
required gate green: precisely the "green because nothing ran" mode the per-name
PASS counting exists to prevent. The driver now compares the array against
`grep -Eo '^func TestApplyInitGatewayCredential[A-Za-z0-9_]*'` on
cmd/bd/init_gateway_test.go, by name and by count, before running anything, and
exits non-zero naming the offending fixture. That file is the whole population --
no same-prefix fixture lives in any other cmd/bd test file.

Release safety (minor): the driver sourced .buildflags and then forced
CGO_ENABLED=0, compiling a package graph disjoint from the ./cmd/bd build the
same job performs two steps earlier under the default. Re-measured under the
tags the steps use: `go list -deps -tags=gms_pure_go ./cmd/bd` is 1505 packages
with cgo and 742 without, and the differing cgo users include `net` and
`os/user`, whose build IDs propagate upward -- so nothing was reused and this
blocking, `cache: false` lane paid a second cold compile on macOS and Windows.
The export is dropped. Two consequences beyond the time: the step becomes
incremental, and the natively executed fixtures now exercise the same build of
cmd/bd that actually ships on those platforms rather than a nocgo one. The
comment now explains the build configuration, which is what the old one did not
do -- it explained why no database is needed, a separate question.

Debuggability (nit): the base comment above test-windows-liveness carried three
checkable mechanism clauses (the test is //go:build windows; the Ubuntu job
selects it by name but compiles it out; main.yml's Windows job runs only on
pushes to main). The replacement stated a conclusion a future maintainer cannot
verify, which is how a redundant-looking CI job gets deleted. The mechanisms are
restored and the new pr-preflight-platforms pointer is appended rather than
substituted.

The remaining nit asked for no change in this PR (the credential cache is keyed
by command string, which is harmless as shipped since neither the marker nor the
failure arm populates the cache) and none was made.

Validation: the driver runs green on Linux under the inherited default CGO --
6 of 6 fixtures PASS, exit 0 -- and the sync check was proved by appending an
unwired seventh fixture, which reds it with exit 1 naming that fixture, before
any test runs. `bash -n` clean, no shellcheck SC2086, and ./scripts/ stays green.

---------

Co-authored-by: Gas City Adopt-PR <adopt-pr@gascity.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 20:10:22 -07:00
..
go-list-test-names Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
lib test(bazel): runfiles helpers + declared inputs for scan-guard tests (#6828) 2026-09-27 08:24:08 -07:00
bazel-sync-patch.sh ci: auto-push Bazel BUILD sync fixes to PRs; harden docs autofix (#6907) 2026-09-28 17:23:27 -07:00
complexity.sh ci: add advisory cyclomatic complexity reporting (#6081) 2026-08-30 19:05:17 -07:00
detect-package-gates.sh docs: go all-in on Mintlify — delete the Docusaurus site and its machinery 2026-07-12 10:37:17 -07:00
fmt-check.sh fix(ci): resolve gofmt from go.mod's toolchain, not PATH (be-gx8) (#6294) 2026-09-30 18:38:46 -07:00
gen_proxied_shard_manifest.py fix(dolt): server-mode bd ready never wakes expired defers (re-proposes #6082) (#6424) 2026-09-30 15:53:22 -07:00
go-test-shard-names.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
go-test-shard-packages.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
gofmt-bin.sh fix(ci): resolve gofmt from go.mod's toolchain, not PATH (be-gx8) (#6294) 2026-09-30 18:38:46 -07:00
install-dolt.sh test(bazel): run every Bazel test against a hermetic, pinned dolt CLI (#6853) 2026-09-27 14:29:49 -07:00
package-bazel-bd.sh ci(bazel): PR-gate parity lanes (docker, pure-Go, js/wasm) + bd artifact (#6887) 2026-09-28 02:03:51 -07:00
package-mcp.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
package-npm.sh Add PR CI wrapper command surface (#4211) 2026-05-29 18:52:53 -07:00
pr-core.sh ci(bazel): advisory Bazel workflow + go test/Bazel equivalence check (#6881) 2026-09-27 23:05:21 -07:00
pr-lint.sh fix(lint): suppress two darwin-only gosec findings and cross-lint the darwin build in CI (#6243) 2026-09-28 15:44:52 -07:00
pr-policy.sh merge(bd-ilb): OpenAPI v0 spec, types-only codegen and drift gates 2026-07-31 18:34:34 +00:00
pull-dolt-image.sh ci: retry Dolt image pulls (bd-m0o1z) (#5228) 2026-08-01 08:18:41 -07:00
test-init-gateway-credential.sh test(init): make gateway credential fixtures portable across native shells (#5715) (#5725) 2026-09-30 20:10:22 -07:00
test-user-config-diagnostic.sh fix(config): identify native config environment in path errors (#6325) 2026-09-28 12:17:20 -07:00
test-windows-env-helpers.sh fix(gitenv): retain explicit null config suppression (#6461) 2026-09-27 15:59:08 -07:00