From fad32bd48a95264f3b3b2a88409622c5b0386be8 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Tue, 31 Mar 2026 11:02:58 +0000 Subject: [PATCH] Fix OpenAPI tests failing on Postgres CI 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) --- server/handlers/openapi_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/handlers/openapi_test.go b/server/handlers/openapi_test.go index 38abd24..806ed75 100644 --- a/server/handlers/openapi_test.go +++ b/server/handlers/openapi_test.go @@ -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) - return sqlite.NewStores(database.TestDB) + if database.IsSQLite() { + return sqlite.NewStores(database.TestDB) + } + return postgres.NewStores(database.TestDB) } // ── Test: Zero extensions → kernel spec only ──────────────────