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

@@ -184,7 +184,15 @@ func BuildSchemaIsolatedDSN(cfg *config.Config, schemaName string) string {
)
}
// (Close already exists below; we reuse it.)
// Exec runs a raw SQL statement against the repository's connection.
// Used by BDD test infra for schema lifecycle (CREATE SCHEMA / DROP SCHEMA).
// Avoid in production code paths -- prefer the typed Repository methods.
func (r *PostgresRepository) Exec(sql string) error {
if r.db == nil {
return fmt.Errorf("Exec called on PostgresRepository with nil db")
}
return r.db.Exec(sql).Error
}
// initializeDatabase sets up the PostgreSQL database connection and runs migrations
func (r *PostgresRepository) initializeDatabase() error {