beads/.github/workflows/regression.yml
matt wilkie 73507cfa6c
ci(regression): pull Dolt sql-server image so tests use shared container (#3737)
Without a cached `dolthub/dolt-sql-server:1.86.0` image,
`isDoltImageCached()` returns false in `internal/testutil/testdoltserver.go`,
`EnsureDoltContainerForTestMain` warns and skips, and `testDoltServerPort`
stays 0. The regression suite then falls back to embedded Dolt per workspace
with `HOME=<t.TempDir()>`, where lockfile/journal writes can race
`os.RemoveAll` during test cleanup.

Observed failure on main run 25413410192 (commit #3735):

    --- FAIL: TestCreateWithParentFlag (2.65s)
        testing.go:1464: TempDir RemoveAll cleanup:
          unlinkat /tmp/TestCreateWithParentFlag2554405098: directory not empty

The test logic passed; the failure was in the framework's TempDir cleanup.
The very next push (#3704) ran clean with no related code changes,
confirming this is environment-dependent flake, not a regression.

Pulling the image up front lets `TestMain` use the shared sql-server
container, removing the per-workspace embedded-Dolt path entirely.
The image tag must stay in sync with `DoltDockerImage` in
`internal/testutil/testdoltcommon.go`.
2026-05-05 20:22:01 -07:00

52 lines
1.8 KiB
YAML

name: Regression Tests
on:
# Run on merges to main
push:
branches: [main]
# Allow manual trigger
workflow_dispatch:
jobs:
regression:
name: Differential Regression (v0.49.6 baseline)
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Install Dolt
run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
- name: Configure Dolt
run: |
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
dolt version
- name: Pull Dolt sql-server image
# Without this, isDoltImageCached() returns false in TestMain and the
# regression suite falls back to embedded Dolt with HOME=<tmpdir>, which
# has a known cleanup race (see beads issue: TestCreateWithParentFlag
# TempDir RemoveAll "directory not empty" flake). Keep the tag in sync
# with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: docker pull dolthub/dolt-sql-server:1.86.0
- name: Cache baseline binary
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ~/.cache/beads-regression
key: regression-baseline-${{ hashFiles('tests/regression/BASELINE_VERSION') }}
- name: Run regression tests
run: go test -tags=regression,gms_pure_go -timeout=10m -v ./tests/regression/...