Compare commits
1 commit
main
...
ci/bazel-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6219ac211d |
6 changed files with 126 additions and 112 deletions
65
.github/workflows/pr.yml
vendored
65
.github/workflows/pr.yml
vendored
|
|
@ -1520,8 +1520,10 @@ jobs:
|
|||
#
|
||||
# D2 step 3: stands down where bazel-coverage says pr_lanes; Bazel's
|
||||
# `dolt-server lane` runs the same packages against a local dolt
|
||||
# sql-server, which test-dolt-server-fingerprint (every PR) keeps equal to
|
||||
# the container this job uses.
|
||||
# sql-server, and //internal/testutil:testutil_dolt_test checks that
|
||||
# server against the checked-in fingerprint. Where this job runs, its
|
||||
# first test step checks the container it uses against the same
|
||||
# fingerprint, so the two backends cannot drift apart unnoticed.
|
||||
test-domain-uow:
|
||||
name: Test (storage domain + uow)
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -1529,7 +1531,7 @@ jobs:
|
|||
if: needs.bazel-coverage.outputs.pr_lanes != 'true'
|
||||
# The race-enabled storage package has outgrown Go's implicit 10-minute
|
||||
# timeout. Keep both per-package deadlines inside one finite job budget.
|
||||
timeout-minutes: 30
|
||||
timeout-minutes: 35
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
|
||||
|
|
@ -1570,6 +1572,14 @@ jobs:
|
|||
sha256sum -c SHA256SUMS
|
||||
chmod +x bd-linux-gms-pure
|
||||
|
||||
# The container this job's tests use, and the local server (the
|
||||
# pinned dolt CLI installed above), against the checked-in
|
||||
# fingerprint. REQUIRE makes the container half fail, not skip.
|
||||
- name: Test Dolt server fingerprint (container + local)
|
||||
env:
|
||||
BEADS_TEST_REQUIRE_DOLT_CONTAINER: "1"
|
||||
run: go test -tags gms_pure_go -count=1 -timeout 5m -v -run '^TestDoltServerFingerprint$' ./internal/testutil/
|
||||
|
||||
- name: Test domain + uow + tracker
|
||||
env:
|
||||
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
||||
|
|
@ -1595,52 +1605,6 @@ jobs:
|
|||
TESTCONTAINERS_RYUK_DISABLED: "true"
|
||||
run: go test -tags gms_pure_go -race -count=1 -timeout 10m -v ./cmd/bd/doctor/fix/
|
||||
|
||||
# Compares the Dolt sql-server container image the container-backed tests
|
||||
# use and the local test server backend (the pinned dolt CLI, what every
|
||||
# Bazel dolt-server lane starts) against the one checked-in fingerprint,
|
||||
# so an image bump cannot drift the container side unnoticed. REQUIRE
|
||||
# makes the container half fail, not skip. Every PR, whatever bazel-coverage
|
||||
# says: it was test-domain-uow's first step, and the Bazel lanes that
|
||||
# replace that job (D2 step 3) have no docker.
|
||||
#
|
||||
# F7a: moved to Blacksmith for same-repo PRs/merge_group. Restores no
|
||||
# GitHub-saved cache (Dolt CLI and the sql-server image are fetched fresh
|
||||
# every run via scripts/ci/install-dolt.sh and pull-dolt-image.sh).
|
||||
test-dolt-server-fingerprint:
|
||||
name: Test (Dolt server fingerprint)
|
||||
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
cache: false
|
||||
|
||||
- name: Install Dolt CLI
|
||||
run: ./scripts/ci/install-dolt.sh
|
||||
|
||||
- name: Verify dolt on PATH
|
||||
run: dolt version
|
||||
|
||||
- name: Configure Git and Dolt identity
|
||||
run: |
|
||||
git config --global user.name "CI Bot"
|
||||
git config --global user.email "ci@beads.test"
|
||||
dolt config --global --add user.name "CI Bot"
|
||||
dolt config --global --add user.email "ci@beads.test"
|
||||
|
||||
- name: Pull Dolt sql-server image
|
||||
# Keep tag in sync with internal/testutil/testdoltcommon.go:DoltDockerImage.
|
||||
run: ./scripts/ci/pull-dolt-image.sh
|
||||
|
||||
- name: Test Dolt server fingerprint (container + local)
|
||||
env:
|
||||
BEADS_TEST_REQUIRE_DOLT_CONTAINER: "1"
|
||||
run: go test -tags gms_pure_go -count=1 -timeout 5m -v -run '^TestDoltServerFingerprint$' ./internal/testutil/
|
||||
|
||||
# `test-macos` / "Test (macos-latest)" used to run here and is deliberately
|
||||
# removed (F4, PR CI -> 5 min). It was a non-required, PR-side mirror of
|
||||
# main.yml's `test` job's macOS leg (full `go test -race -short ./...`),
|
||||
|
|
@ -2421,7 +2385,6 @@ jobs:
|
|||
- scripts-go-checks
|
||||
- pr-lint-wrapper
|
||||
- test-domain-uow
|
||||
- test-dolt-server-fingerprint
|
||||
- contract-corpus
|
||||
- windows-make-shell
|
||||
- bazel
|
||||
|
|
@ -2453,7 +2416,6 @@ jobs:
|
|||
SCRIPTS_GO_CHECKS
|
||||
PR_LINT_WRAPPER
|
||||
TEST_DOMAIN_UOW
|
||||
TEST_DOLT_SERVER_FINGERPRINT
|
||||
CONTRACT_CORPUS
|
||||
WINDOWS_MAKE_SHELL
|
||||
BAZEL
|
||||
|
|
@ -2509,7 +2471,6 @@ jobs:
|
|||
SCRIPTS_GO_CHECKS: ${{ needs.scripts-go-checks.result }}
|
||||
PR_LINT_WRAPPER: ${{ needs.pr-lint-wrapper.result }}
|
||||
TEST_DOMAIN_UOW: ${{ needs.test-domain-uow.result }}
|
||||
TEST_DOLT_SERVER_FINGERPRINT: ${{ needs.test-dolt-server-fingerprint.result }}
|
||||
CONTRACT_CORPUS: ${{ needs.contract-corpus.result }}
|
||||
WINDOWS_MAKE_SHELL: ${{ needs.windows-make-shell.result }}
|
||||
# bazel.yml's lanes report their job.status as outputs; a lane that
|
||||
|
|
|
|||
|
|
@ -646,7 +646,6 @@ Do not require these existing check names directly:
|
|||
- `Test (ubuntu-latest)`
|
||||
- `Test (macos-latest)`
|
||||
- `Test (storage domain + uow)`
|
||||
- `Test (Dolt server fingerprint)`
|
||||
- `Go checks (vet)`
|
||||
- `Contract corpus (golden + determinism + conformance)`
|
||||
- `PR Core (wrapper timing)`
|
||||
|
|
@ -920,11 +919,16 @@ manifests. On those PRs they are the tiers' only pre-merge run, and
|
|||
timing measured there), `ubuntu-latest` otherwise. `bazel-test`'s own
|
||||
`bazel-ci-build-artifacts` upload is no longer consumed by anything; it
|
||||
is kept for the F3.5.3 SHA256SUMS comparison and for debugging.
|
||||
- Kept on every PR: the Dolt server fingerprint (container image vs the
|
||||
pinned dolt CLI the Bazel dolt-server lanes start), formerly
|
||||
`test-domain-uow`'s first step, is its own required job
|
||||
`test-dolt-server-fingerprint` (`Test (Dolt server fingerprint)`,
|
||||
`TEST_DOLT_SERVER_FINGERPRINT`). `check-release-target-cross-compilation`
|
||||
- The Dolt server fingerprint is checked per backend, where that backend
|
||||
runs. The local server (the pinned dolt CLI every Bazel dolt-server lane
|
||||
starts) is checked by `//internal/testutil:testutil_dolt_test` on the
|
||||
dolt-server lane. The container is checked by `test-domain-uow`'s first
|
||||
test step, which runs only where the container-backed jobs run (not
|
||||
covered by `pr_lanes`). The every-PR job `test-dolt-server-fingerprint`
|
||||
(`Test (Dolt server fingerprint)`, `TEST_DOLT_SERVER_FINGERPRINT`)
|
||||
pulled a docker image the workers do not have, so it is retired; the
|
||||
image tag stays pinned to the dolt release by
|
||||
`TestPinnedDoltCLIMatchesContainerImage`. `check-release-target-cross-compilation`
|
||||
still `go build`s `./...` with `CGO_ENABLED=0` on every PR.
|
||||
- Also kept on every PR, in the required job `scripts-go-checks`
|
||||
(`SCRIPTS_GO_CHECKS`, one leg, `Go checks (vet)`): `go test`'s own vet
|
||||
|
|
@ -1182,8 +1186,9 @@ scope, not this slice's.
|
|||
`TestSameRepoBlacksmithRunners` and `TestSameRepoBlacksmithExpressionSemantics`
|
||||
in `scripts/ci_workflow_test.go`): pr.yml's `fast-checks`,
|
||||
`advisory-reports`, `check-release-target-cross-compilation` (8 vCPU),
|
||||
`check-doc-flags` (4 vCPU), `pr-policy-wrapper` (4 vCPU),
|
||||
`test-dolt-server-fingerprint`; pr-risk.yml's `test-nix` (4 vCPU). Every
|
||||
`check-doc-flags` (4 vCPU), `pr-policy-wrapper` (4 vCPU)
|
||||
(and `test-dolt-server-fingerprint`, since retired); pr-risk.yml's
|
||||
`test-nix` (4 vCPU). Every
|
||||
other job keeps the default 2 vCPU label. Forks and Dependabot PRs fall back
|
||||
to `ubuntu-latest`, as F3's `bazel-coverage`/`ci-gate`/`detect-ci-tier` jobs
|
||||
and bazel.yml's `rbe` job already do; `TestBlacksmithJobsReadNoSecrets`
|
||||
|
|
@ -1490,7 +1495,7 @@ PR timings, 2026-10): `fast-checks` (~40 s), `pr-policy-wrapper`
|
|||
`check-doc-freshness-platforms` and `pr-preflight-platforms` (Linux,
|
||||
Windows and macOS legs, up to ~5 min on Windows),
|
||||
`check-release-target-cross-compilation` (~5 min),
|
||||
`test-dolt-server-fingerprint` (~1 min), `windows-make-shell` (~2.7 min),
|
||||
`windows-make-shell` (~2.7 min),
|
||||
`windows-test-binaries` plus the prebuilt Windows pair (~7 min end to
|
||||
end), the advisory native Windows pair (~5 min; the gate waits for them),
|
||||
`test-nix` (~3 min) and the package gates (seconds unless their paths
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
load("@rules_go//go:def.bzl", "go_library", "go_test")
|
||||
load("@rules_shell//shell:sh_test.bzl", "sh_test")
|
||||
|
||||
go_library(
|
||||
name = "testutil",
|
||||
|
|
@ -125,6 +126,57 @@ go_test(
|
|||
],
|
||||
)
|
||||
|
||||
# testutil_test on the dolt-server lane: the package's own tests of the
|
||||
# test-server backends, with the local backend selected and required, so
|
||||
# TestDoltServerFingerprint's local half (formerly pr.yml's "Test (Dolt
|
||||
# server fingerprint)" job, every PR) and the TestLocalDoltServer_* tests run
|
||||
# against the pinned dolt in the test wrapper's runfiles. Every other
|
||||
# configuration of testutil_test passes BEADS_TEST_SKIP=dolt and skips them.
|
||||
# The container half needs docker: testutil_docker_test below runs it on the
|
||||
# docker lane, and TestPinnedDoltCLIMatchesContainerImage (//scripts) keeps
|
||||
# the image tag on the pinned release.
|
||||
#
|
||||
# Tags:
|
||||
# dolt-server: starts hermetic dolt sql-servers from the pinned dolt in the
|
||||
# test wrapper's runfiles (BEADS_TEST_DOLT_SERVER=local); excluded from
|
||||
# --config=prcore/ci, selected by --config=doltserver.
|
||||
sh_test(
|
||||
name = "testutil_dolt_test",
|
||||
size = "medium",
|
||||
srcs = ["//tools/bazel:go_test_variant.sh"],
|
||||
args = ["$(rootpath :testutil_test)"],
|
||||
data = [":testutil_test"],
|
||||
env = {
|
||||
"BEADS_TEST_DOLT_SERVER": "local",
|
||||
"BEADS_TEST_REQUIRE_DOLT_CONTAINER": "1",
|
||||
},
|
||||
tags = ["dolt-server"],
|
||||
)
|
||||
|
||||
# The same tests with the container backend selected and required: the A/B
|
||||
# control for testutil_dolt_test, and the only place TestDoltServerFingerprint's
|
||||
# container half runs in CI (bazel.yml's docker lane, dolt-lane=docker).
|
||||
#
|
||||
# Tags:
|
||||
# requires-docker: needs a docker daemon and the cached dolt-sql-server
|
||||
# image; selected by --config=docker.
|
||||
# no-remote-exec: the docker lane runs on the host.
|
||||
sh_test(
|
||||
name = "testutil_docker_test",
|
||||
size = "medium",
|
||||
srcs = ["//tools/bazel:go_test_variant.sh"],
|
||||
args = ["$(rootpath :testutil_test)"],
|
||||
data = [":testutil_test"],
|
||||
env = {
|
||||
"BEADS_TEST_DOLT_SERVER": "container",
|
||||
"BEADS_TEST_REQUIRE_DOLT_CONTAINER": "1",
|
||||
},
|
||||
tags = [
|
||||
"no-remote-exec",
|
||||
"requires-docker",
|
||||
],
|
||||
)
|
||||
|
||||
# --- begin repo_files (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
|
||||
|
||||
filegroup(
|
||||
|
|
|
|||
|
|
@ -987,10 +987,11 @@ func TestPRCIGateRequiresGeneratedHookTimeoutProcessBoundary(t *testing.T) {
|
|||
|
||||
func TestStorageDomainUOWJobsUseNestedTimeoutBudgets(t *testing.T) {
|
||||
const (
|
||||
fingerprintTimeoutMinutes = 5
|
||||
storageTimeoutMinutes = 15
|
||||
doctorTimeoutMinutes = 10
|
||||
setupTeardownSlackMinutes = 5
|
||||
jobTimeoutMinutes = storageTimeoutMinutes + doctorTimeoutMinutes + setupTeardownSlackMinutes
|
||||
jobTimeoutMinutes = fingerprintTimeoutMinutes + storageTimeoutMinutes + doctorTimeoutMinutes + setupTeardownSlackMinutes
|
||||
)
|
||||
storageCommand := fmt.Sprintf(
|
||||
"go test -tags gms_pure_go -race -count=1 -timeout %dm -v ./internal/storage/domain/... ./internal/storage/uow/... ./internal/tracker/...",
|
||||
|
|
@ -1008,25 +1009,24 @@ func TestStorageDomainUOWJobsUseNestedTimeoutBudgets(t *testing.T) {
|
|||
// Go's timeout applies per package test binary, so this is a
|
||||
// maintenance tripwire for the declared sequential tier budgets,
|
||||
// not a mathematical upper bound for the multi-package first step.
|
||||
if job.TimeoutMinutes <= storageTimeoutMinutes+doctorTimeoutMinutes {
|
||||
if job.TimeoutMinutes <= fingerprintTimeoutMinutes+storageTimeoutMinutes+doctorTimeoutMinutes {
|
||||
t.Errorf(
|
||||
"test-domain-uow timeout = %d minutes, want more than %d minutes of declared tier budgets",
|
||||
job.TimeoutMinutes,
|
||||
storageTimeoutMinutes+doctorTimeoutMinutes)
|
||||
fingerprintTimeoutMinutes+storageTimeoutMinutes+doctorTimeoutMinutes)
|
||||
}
|
||||
assertStepRunsExactly(t, job, "Test domain + uow + tracker", storageCommand)
|
||||
assertStepRunsExactly(t, job, "Test doctor/fix (Dolt-backed, hard-require container)", doctorCommand)
|
||||
})
|
||||
}
|
||||
|
||||
// The container and local test servers are compared in pr.yml's own
|
||||
// every-PR job (it was test-domain-uow's first step until D2 step 3;
|
||||
// TestPRDoltServerFingerprintRunsOnEveryPR pins it).
|
||||
// The container this job uses is compared with the checked-in
|
||||
// fingerprint in its first test step
|
||||
// (TestDoltServerFingerprintRunsWhereEachBackendRuns pins where).
|
||||
job := readCIWorkflow(t, "pr.yml").job(t, prFingerprintJob)
|
||||
const fingerprintStep = "Test Dolt server fingerprint (container + local)"
|
||||
assertStepRunsExactly(t, job, fingerprintStep,
|
||||
"go test -tags gms_pure_go -count=1 -timeout 5m -v -run '^TestDoltServerFingerprint$' ./internal/testutil/")
|
||||
assertStepEnvValue(t, job, fingerprintStep, "BEADS_TEST_REQUIRE_DOLT_CONTAINER", "1")
|
||||
assertStepRunsExactly(t, job, prFingerprintStep,
|
||||
fmt.Sprintf("go test -tags gms_pure_go -count=1 -timeout %dm -v -run '^TestDoltServerFingerprint$' ./internal/testutil/", fingerprintTimeoutMinutes))
|
||||
assertStepEnvValue(t, job, prFingerprintStep, "BEADS_TEST_REQUIRE_DOLT_CONTAINER", "1")
|
||||
|
||||
gate := readCIWorkflow(t, "pr.yml").job(t, "ci-gate")
|
||||
gateEnv := gate.step(t, "Evaluate CI gate").Env
|
||||
|
|
@ -3013,7 +3013,6 @@ func TestSameRepoBlacksmithRunners(t *testing.T) {
|
|||
"bazel-coverage": sameRepoBlacksmith2vcpu, "ci-gate": sameRepoBlacksmith2vcpu,
|
||||
"fast-checks": sameRepoBlacksmith2vcpu,
|
||||
"advisory-reports": sameRepoBlacksmith2vcpu,
|
||||
"test-dolt-server-fingerprint": sameRepoBlacksmith2vcpu,
|
||||
"check-doc-flags": sameRepoBlacksmith4vcpu,
|
||||
"pr-policy-wrapper": sameRepoBlacksmith4vcpu,
|
||||
"check-release-target-cross-compilation": sameRepoBlacksmith8vcpu,
|
||||
|
|
|
|||
|
|
@ -20,14 +20,15 @@ import (
|
|||
// (BAZEL_PR_LANES_RETIRED, simulated with the other tiers in
|
||||
// TestPRRiskDecisionMatchesBazelMode). Everything the retired jobs did
|
||||
// besides those tests keeps running on every PR: the package gates take the
|
||||
// Bazel-built bd, the Dolt server fingerprint has its own job, and
|
||||
// scripts-go-checks runs go test's vet checks.
|
||||
// Bazel-built bd, the Dolt server fingerprint runs on the dolt-server lane
|
||||
// (its local half) and in test-domain-uow (its container half, where
|
||||
// containers are used), and scripts-go-checks runs go test's vet checks.
|
||||
|
||||
const (
|
||||
// The legacy jobs' if: not covered.
|
||||
prLaneLegacyIf = "needs." + prRiskCoverageJobName + ".outputs.pr_lanes != 'true'"
|
||||
prFingerprintJob = "test-dolt-server-fingerprint"
|
||||
prFingerprintID = "TEST_DOLT_SERVER_FINGERPRINT"
|
||||
prFingerprintJob = "test-domain-uow"
|
||||
prFingerprintStep = "Test Dolt server fingerprint (container + local)"
|
||||
prScriptsChecksJob = "scripts-go-checks"
|
||||
prScriptsChecksID = "SCRIPTS_GO_CHECKS"
|
||||
// bazel.yml's lanes for the step add --config=sole-run whenever they
|
||||
|
|
@ -337,7 +338,7 @@ func TestPRLegacyLanesDeferToBazelLanes(t *testing.T) {
|
|||
}
|
||||
for _, c := range []string{"true", "false"} {
|
||||
for _, res := range []string{"skipped", "failure", "cancelled"} {
|
||||
for _, job := range []string{prFingerprintJob, "package-mcp", "package-npm", "pr-preflight-platforms", prScriptsChecksJob} {
|
||||
for _, job := range []string{"package-mcp", "package-npm", "pr-preflight-platforms", prScriptsChecksJob} {
|
||||
sc := prGateFor(t, lanes, "pull_request", "remote", cov(c))
|
||||
// F3: package-mcp/package-npm are bazel.yml call outputs
|
||||
// (needs.bazel.outputs.package-mcp), not pr.yml job
|
||||
|
|
@ -348,7 +349,7 @@ func TestPRLegacyLanesDeferToBazelLanes(t *testing.T) {
|
|||
} else {
|
||||
sc.results = map[string]string{job: res}
|
||||
}
|
||||
id := map[string]string{prFingerprintJob: prFingerprintID, "pr-preflight-platforms": "PR_PREFLIGHT_PLATFORMS", prScriptsChecksJob: prScriptsChecksID}[job]
|
||||
id := map[string]string{"pr-preflight-platforms": "PR_PREFLIGHT_PLATFORMS", prScriptsChecksJob: prScriptsChecksID}[job]
|
||||
if id == "" {
|
||||
id = prPackageGateIDs[job]
|
||||
}
|
||||
|
|
@ -545,47 +546,43 @@ func testPackageGateJobs(t *testing.T, prGateRequired []string) {
|
|||
}
|
||||
}
|
||||
|
||||
// The Dolt server fingerprint (container image vs the pinned dolt CLI the
|
||||
// Bazel dolt-server lanes start) runs on every PR in its own required job,
|
||||
// whatever bazel-coverage says, and nowhere else in pr.yml.
|
||||
func TestPRDoltServerFingerprintRunsOnEveryPR(t *testing.T) {
|
||||
// The Dolt server fingerprint is checked once per backend, where that backend
|
||||
// runs: the local server (the pinned dolt CLI every Bazel dolt-server lane
|
||||
// starts) by //internal/testutil:testutil_dolt_test on the dolt-server lane,
|
||||
// whatever the mode (the retired every-PR job, "Test (Dolt server
|
||||
// fingerprint)", pulled a docker image the workers do not have); the
|
||||
// container by test-domain-uow, the container-backed job that runs only
|
||||
// where bazel-coverage does not cover pr_lanes, as its first test step. No
|
||||
// other pr.yml job runs it, and ci-gate has no separate fingerprint result.
|
||||
func TestDoltServerFingerprintRunsWhereEachBackendRuns(t *testing.T) {
|
||||
pr := readCIWorkflow(t, "pr.yml")
|
||||
job := pr.job(t, prFingerprintJob)
|
||||
// F7a: moved to the same same-repo Blacksmith expression every other
|
||||
// cache-free same-repo pr.yml job uses; forks/Dependabot still fall back
|
||||
// to ubuntu-latest (TestSameRepoBlacksmithRunners covers that fallback).
|
||||
if job.If != "" || len(job.Needs) != 0 || job.ContinueOnError || job.RunsOn != sameRepoBlacksmith2vcpu || job.TimeoutMinutes == 0 {
|
||||
t.Errorf("%s: if %q, needs %v, continue-on-error %v, runs-on %q, timeout %d; want an unconditional same-repo-Blacksmith job with a timeout",
|
||||
prFingerprintJob, job.If, job.Needs, job.ContinueOnError, job.RunsOn, job.TimeoutMinutes)
|
||||
if job.If != prLaneLegacyIf {
|
||||
t.Errorf("%s if %q, want %q (the container-backed tests run only there)", prFingerprintJob, job.If, prLaneLegacyIf)
|
||||
}
|
||||
var names []string
|
||||
for _, s := range job.Steps {
|
||||
if s.If != "" || s.ContinueOnError != nil {
|
||||
t.Errorf("%s step %q: if %q, continue-on-error %v", prFingerprintJob, s.Name, s.If, s.ContinueOnError)
|
||||
step := job.step(t, prFingerprintStep)
|
||||
if step.If != "" || step.ContinueOnError != nil {
|
||||
t.Errorf("%s step %q: if %q, continue-on-error %v", prFingerprintJob, prFingerprintStep, step.If, step.ContinueOnError)
|
||||
}
|
||||
assertStepsBefore(t, job, []string{"Install Dolt CLI", "Pull Dolt sql-server image"}, []string{prFingerprintStep})
|
||||
assertStepsBefore(t, job, []string{prFingerprintStep}, []string{"Test domain + uow + tracker"})
|
||||
for name, j := range pr.Jobs {
|
||||
for _, s := range j.Steps {
|
||||
if strings.Contains(s.Run, "TestDoltServerFingerprint") && (name != prFingerprintJob || s.Name != prFingerprintStep) {
|
||||
t.Errorf("%s step %q runs the fingerprint; only %s's %q does", name, s.Name, prFingerprintJob, prFingerprintStep)
|
||||
}
|
||||
}
|
||||
names = append(names, s.Name)
|
||||
}
|
||||
want := []string{"", "Set up Go", "Install Dolt CLI", "Verify dolt on PATH", "Configure Git and Dolt identity", "Pull Dolt sql-server image", "Test Dolt server fingerprint (container + local)"}
|
||||
if !reflect.DeepEqual(names, want) {
|
||||
t.Errorf("%s steps %q, want %q", prFingerprintJob, names, want)
|
||||
}
|
||||
if got, want := job.step(t, "Pull Dolt sql-server image").Run, pr.job(t, "test-domain-uow").step(t, "Pull Dolt sql-server image").Run; got != want {
|
||||
t.Errorf("%s pulls the image with %q, test-domain-uow with %q", prFingerprintJob, got, want)
|
||||
}
|
||||
if got := job.step(t, "Install Dolt CLI").Run; got != "./scripts/ci/install-dolt.sh" {
|
||||
t.Errorf("%s installs dolt with %q", prFingerprintJob, got)
|
||||
}
|
||||
gate := pr.job(t, "ci-gate")
|
||||
env := gate.step(t, "Evaluate CI gate").Env
|
||||
if !contains(gate.Needs, prFingerprintJob) || env[prFingerprintID] != "${{ needs."+prFingerprintJob+".result }}" ||
|
||||
!contains(strings.Fields(env["CI_GATE_REQUIRED"]), prFingerprintID) {
|
||||
t.Errorf("ci-gate does not require %s", prFingerprintID)
|
||||
if _, ok := env["TEST_DOLT_SERVER_FINGERPRINT"]; ok || strings.Contains(env["CI_GATE_REQUIRED"], "FINGERPRINT") {
|
||||
t.Errorf("ci-gate still evaluates a separate fingerprint result: %q", env["CI_GATE_REQUIRED"])
|
||||
}
|
||||
for name, j := range pr.Jobs {
|
||||
for _, s := range j.Steps {
|
||||
if strings.Contains(s.Run, "TestDoltServerFingerprint") && name != prFingerprintJob {
|
||||
t.Errorf("%s step %q runs the fingerprint; only %s does", name, s.Name, prFingerprintJob)
|
||||
}
|
||||
|
||||
rule := bazelRuleBlock(readPolicyFile(t, sourceRepoRoot(t), "internal/testutil/BUILD.bazel"), "testutil_dolt_test")
|
||||
for _, w := range []string{`"$(rootpath :testutil_test)"`, `"BEADS_TEST_DOLT_SERVER": "local"`, `"BEADS_TEST_REQUIRE_DOLT_CONTAINER": "1"`, `tags = ["dolt-server"]`} {
|
||||
if !strings.Contains(rule, w) {
|
||||
t.Errorf("//internal/testutil:testutil_dolt_test lacks %s (the local half runs on the dolt-server lane):\n%s", w, rule)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func TestPullDoltImageRetriesTransientFailures(t *testing.T) {
|
|||
|
||||
func TestDoltImagePullWorkflowsUseRetryHelper(t *testing.T) {
|
||||
wantCalls := map[string]int{
|
||||
"pr.yml": 3, // test-domain-uow, contract-corpus, test-dolt-server-fingerprint
|
||||
"pr.yml": 2, // test-domain-uow, contract-corpus
|
||||
"pr-risk.yml": 3,
|
||||
"regression.yml": 1,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue