feat(bdd): parallel-safe schema-per-package isolation (T12 stage 2/2) — 2.85x speedup (#35)
Some checks failed
CI/CD Pipeline / Build Docker Cache (push) Successful in 7s
CI/CD Pipeline / CI Pipeline (push) Failing after 3m58s
CI/CD Pipeline / Trigger Docker Push (push) Has been skipped

Per-package isolated Postgres schema with migrations. Local benchmark: 12.87s sequential → 4.51s parallel = 2.85x. ADR-0025 status to Implemented. CI uses BDD_SCHEMA_ISOLATION=true.

Co-authored-by: Gabriel Radureau <arcodange@gmail.com>
Co-committed-by: Gabriel Radureau <arcodange@gmail.com>
This commit was merged in pull request #35.
This commit is contained in:
2026-05-03 19:42:09 +02:00
committed by arcodange
parent 4452620df8
commit 82feaec51f
6 changed files with 116 additions and 24 deletions

View File

@@ -219,10 +219,12 @@ jobs:
export DLC_DATABASE_PASSWORD=postgres
export DLC_DATABASE_NAME=dance_lessons_coach_bdd_test
export DLC_DATABASE_SSL_MODE=disable
# NOTE: BDD_SCHEMA_ISOLATION was tried (PR #26) but creates empty per-scenario schemas
# without table migrations, causing 500 errors on registration. Reverted in PR #28.
# The default mode (CleanupDatabase truncates between scenarios) works fine when tests
# run sequentially (Go BDD doesn't use t.Parallel by default).
# T12: per-package isolated Postgres schema with migrations (re-enables what
# PR #26 attempted but couldn't deliver because the empty schemas had no tables).
# The fix: testserver Start() now builds a per-package isolated repo via
# user.NewPostgresRepositoryFromDSN which DOES run AutoMigrate against the new
# schema. Packages then run in parallel (~2.85x speedup observed locally).
export BDD_SCHEMA_ISOLATION=true
./scripts/run-bdd-tests.sh
# Generate BDD coverage report