beads/scripts/ci/pr-core.sh
Julian Knutsen 9d13485b71
ci(bazel): retire main.yml's Linux jobs, nightly's go test jobs and ci-measurements (#7354)
Push to main and the nightly schedule no longer run go test or repo checks
on GitHub runners (ga-96smfk.22, ga-96smfk.58):

- main.yml keeps only the macOS -race -short suite, the Windows smoke build
  and the push-to-main savers of the GOCACHEs pr.yml's Windows/macOS jobs
  restore. Its Linux jobs (migration hygiene, build artifacts, build tags,
  versions, duplicate migrations, doc flags, package gates, PR policy
  wrapper, gofmt, the Linux and setup-go cache seeders, the Nix flake
  check) are gated on the merge queue's pr.yml/pr-risk.yml run of the
  same commit and re-run as Bazel targets by bazel.yml's push run.
- nightly.yml is the fresh bazel.yml call plus the worker-env check; its
  Full Test Suite, PR Core go-test-json side and measure dispatch are gone,
  as are ci-measurements.yml and bazel.yml's go-test-json-artifact input.
- The non-race embedded batch-apply step becomes
  //internal/storage/embeddeddolt:embeddeddolt_batch_apply_nonrace_test
  (go_test_race_off, BEADS_TEST_EMBEDDED_DOLT=1) in the embedded tier.
- make ci-pr-policy and scripts/ci/pr-policy.sh go: every check it ran is
  a Bazel test (TestPRPolicyChecksRunAsBazelTargets).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 10:06:59 +00:00

43 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
# Required fast PR Go test contract.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# shellcheck source=../.buildflags
source "$REPO_ROOT/.buildflags"
# shellcheck source=lib/timing.sh
source "$REPO_ROOT/scripts/ci/lib/timing.sh"
# shellcheck source=lib/test-env.sh
source "$REPO_ROOT/scripts/ci/lib/test-env.sh"
cd "$REPO_ROOT"
beads_test_env_enter
GO_TEST_PKG_PARALLEL="${GO_TEST_PKG_PARALLEL:-4}"
GO_TEST_PARALLEL="${GO_TEST_PARALLEL:-4}"
# Without an explicit -timeout every package gets Go's 10m default, and ./cmd/bd
# has outgrown it: measured through this wrapper it takes 572s, which leaves 28s
# — under 5% — of margin. Runner variance eats that, and the package then dies on
# the alarm at 600.3s/600.7s (two consecutive runs on #6090; #6038 squeaked in
# just under). No single test is at fault, so the panic names whichever one was
# in flight and reads like a hang when it is really the whole package running out
# of clock. 30m is what every other -race lane here already gives this same code:
# main.yml's macOS test job. Splitting or de-slowing cmd/bd is the real fix and belongs on main
# — this only stops the clock from being the thing that fails.
# BEADS_PR_CORE_GO_TEST_JSON=<file>: same run, `go test -json` output to <file>
# (for tools/bazel/equivalence.py --go-test-json, the skip-parity check).
go_test() {
if [[ -n "${BEADS_PR_CORE_GO_TEST_JSON:-}" ]]; then
go test -json "$@" >"$BEADS_PR_CORE_GO_TEST_JSON"
else
go test "$@"
fi
}
ci_time "pr-core go test" -- \
go_test -p "$GO_TEST_PKG_PARALLEL" -parallel "$GO_TEST_PARALLEL" -race -short -timeout=30m -skip '^TestEmbedded' ./...