ci: the integration lane runs only packages with database tests, built in parallel first
release / go (push) Successful in 1m52s
release / web (push) Failing after 5s
release / govulncheck (push) Successful in 19s
release / integration (push) Successful in 3m15s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / Build signed APK (push) Canceled after 4m8s
release / android (push) Canceled after 4m33s

The integration job ran `go test -p 1 -race ./...`: every package, one at
a time, including 18 with no database test whose unit tests the go lane
had already run. -p 1 also serialized compiling, about 50s before the
first test ran.

ci/db-test-packages.sh lists the packages whose tests reach Postgres
(through internal/dbtest or MINSTREL_TEST_DATABASE_URL); a package that
mentions neither cannot run a database test. The job builds those test
binaries with full parallelism (-run '^$'), then runs them serially as
before. make test-integration uses the same list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 10:19:56 -05:00
co-authored by Claude Opus 5.5
parent 56285881aa
commit 7fe0c68899
5 changed files with 41 additions and 18 deletions
+17 -9
View File
@@ -286,16 +286,24 @@ jobs:
fi
# Apply embedded migrations to the fresh test DB, then run the
# full suite (no -short → integration tests execute). -p 1:
# every integration package TRUNCATEs the one shared test DB;
# concurrent package binaries → TRUNCATE deadlocks. Serialize
# package execution (the documented local invocation too).
# -timeout 20m: internal/api alone takes several minutes under
# -race on an idle runner, and a dev and a main run sharing the
# runner can push it past go test's default 10m with nothing
# hung.
# packages that hold database tests (no -short, so they execute).
# The `go` lane already runs every unit test; packages with no
# database test are left to it (ci/db-test-packages.sh).
#
# -p 1: every database package TRUNCATEs the one shared test DB,
# and concurrent package binaries deadlock on TRUNCATE. -p also
# bounds compiling, so the test binaries are built first with
# full parallelism (-run '^$' runs no test), and the serial pass
# reuses the build cache.
#
# -timeout 20m: internal/api alone takes minutes under -race on a
# busy runner, and a dev and a main run sharing the runner can
# push it past go test's default 10m with nothing hung.
MINSTREL_DATABASE_URL="$MINSTREL_TEST_DATABASE_URL" go run ./cmd/minstrel migrate
go test -p 1 -race -timeout 20m ./...
PKGS=$(sh ci/db-test-packages.sh)
echo "database test packages: $(echo "$PKGS" | wc -l)"
go test -race -run '^$' $PKGS
go test -p 1 -race -timeout 20m $PKGS
web:
runs-on: go-ci