fix(ci): Handlers-PG pgvector + memory integration test (#2540) #2590
@@ -208,6 +208,16 @@ jobs:
|
||||
echo "waiting for postgres at ${PG_HOST}:5432..."; sleep 2
|
||||
done
|
||||
|
||||
# core#2540: pgvector extension must be present BEFORE any migration
|
||||
# or integration test that uses the vector(1536) type. The
|
||||
# pgvector/pgvector:pg15 image ships the extension files but the
|
||||
# extension is NOT auto-created in each database — we do it here
|
||||
# once so both migrations (031_memories_pgvector) and handler
|
||||
# integration tests (memories_integration_test.go) see the type.
|
||||
psql -h "${PG_HOST}" -U postgres -d molecule -c \
|
||||
"CREATE EXTENSION IF NOT EXISTS vector;" >/dev/null
|
||||
echo "✓ pgvector extension ensured"
|
||||
|
||||
# Apply every .up.sql in lexicographic order with
|
||||
# ON_ERROR_STOP=0 — failing migrations are SKIPPED rather than
|
||||
# blocking the suite. This handles the current schema state
|
||||
|
||||
@@ -84,10 +84,11 @@ func memoryIntegrationDB(t *testing.T) *sql.DB {
|
||||
// own migrations under cmd/memory-plugin-postgres/migrations/).
|
||||
//
|
||||
// We create the pgvector extension first so the vector(1536) column
|
||||
// type resolves. If the extension is unavailable, the test skips
|
||||
// rather than failing with an opaque "relation does not exist".
|
||||
// type resolves. The CI workflow uses pgvector/pgvector:pg15 and
|
||||
// creates the extension before migrations; if it is still missing here,
|
||||
// the test environment is mis-configured and must fail loud.
|
||||
if _, err := conn.ExecContext(ctx, `CREATE EXTENSION IF NOT EXISTS vector;`); err != nil {
|
||||
t.Skipf("pgvector extension unavailable — memory integration tests require pgvector: %v", err)
|
||||
t.Fatalf("pgvector extension unavailable — memory integration tests require pgvector: %v", err)
|
||||
}
|
||||
if _, err := conn.ExecContext(ctx, `
|
||||
CREATE TABLE IF NOT EXISTS memory_namespaces (
|
||||
|
||||
Reference in New Issue
Block a user