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
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:
@@ -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 ──────────────────
|
||||
|
||||
Reference in New Issue
Block a user