Fix OpenAPI tests failing on Postgres CI
All checks were successful
CI/CD / detect-changes (pull_request) Successful in 4s
CI/CD / test-frontend (pull_request) Successful in 5s
CI/CD / test-go-pg (pull_request) Successful in 2m42s
CI/CD / test-sqlite (pull_request) Successful in 2m47s
CI/CD / build-and-deploy (pull_request) Successful in 1m39s

openapiTestStores() was hardcoded to sqlite.NewStores() regardless of
the DB backend. When CI runs against Postgres, the SQLite ? placeholders
cause "syntax error at or near ','". Use the same IsSQLite() check
pattern as packages_bundled_test.go.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 11:02:58 +00:00
parent e4b5f4e8a8
commit fad32bd48a

View File

@@ -7,7 +7,8 @@ import (
"switchboard-core/database"
"switchboard-core/store"
"switchboard-core/store/sqlite"
postgres "switchboard-core/store/postgres"
sqlite "switchboard-core/store/sqlite"
)
// Minimal static spec for testing — valid OpenAPI 3.0 structure.
@@ -32,7 +33,10 @@ func openapiTestStores(t *testing.T) store.Stores {
t.Helper()
database.RequireTestDB(t)
database.TruncateAll(t)
if database.IsSQLite() {
return sqlite.NewStores(database.TestDB)
}
return postgres.NewStores(database.TestDB)
}
// ── Test: Zero extensions → kernel spec only ──────────────────