Skip to content

Commit e3ab647

Browse files
authored
test: expand extension smoke tests
test: expand extension smoke tests
2 parents e2e0f70 + 21d2476 commit e3ab647

1 file changed

Lines changed: 30 additions & 11 deletions

File tree

.github/workflows/ci-kilobase-runner.yaml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,36 @@ jobs:
158158
159159
- name: Test KBVE extensions
160160
run: |
161-
echo "=== Test pgvector ==="
162-
docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -c "CREATE EXTENSION IF NOT EXISTS vector; SELECT extname, extversion FROM pg_extension WHERE extname = 'vector';"
163-
164-
echo "=== Test kilobase ==="
165-
docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -c "CREATE EXTENSION kilobase; SELECT extname, extversion FROM pg_extension WHERE extname = 'kilobase';"
166-
167-
echo "=== Test vchord ==="
168-
docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -c "CREATE EXTENSION vchord; SELECT extname, extversion FROM pg_extension WHERE extname = 'vchord';"
169-
170-
echo "=== Verify all loaded ==="
171-
docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('vector', 'kilobase', 'vchord') ORDER BY extname;"
161+
PSQL="docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -v ON_ERROR_STOP=1"
162+
163+
echo "=== Load extensions ==="
164+
$PSQL -c "CREATE EXTENSION IF NOT EXISTS vector;"
165+
$PSQL -c "CREATE EXTENSION kilobase;"
166+
$PSQL -c "CREATE EXTENSION vchord;"
167+
$PSQL -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('vector', 'kilobase', 'vchord') ORDER BY extname;"
168+
169+
echo "=== Smoke test: pgvector ==="
170+
$PSQL <<'SQL'
171+
CREATE TABLE test_embeddings (id serial PRIMARY KEY, embedding vector(3));
172+
INSERT INTO test_embeddings (embedding) VALUES ('[1,2,3]'), ('[4,5,6]'), ('[7,8,9]');
173+
SELECT id, embedding, embedding <-> '[1,1,1]' AS distance FROM test_embeddings ORDER BY embedding <-> '[1,1,1]' LIMIT 2;
174+
DROP TABLE test_embeddings;
175+
SQL
176+
177+
echo "=== Smoke test: kilobase ==="
178+
$PSQL <<'SQL'
179+
SELECT kilobase_info();
180+
SQL
181+
182+
echo "=== Smoke test: vchord ==="
183+
$PSQL <<'SQL'
184+
CREATE TABLE test_vchord (id serial PRIMARY KEY, embedding vector(3));
185+
INSERT INTO test_vchord (embedding) SELECT ('[' || (random()*10)::int || ',' || (random()*10)::int || ',' || (random()*10)::int || ']')::vector FROM generate_series(1, 100);
186+
SELECT COUNT(*) AS row_count FROM test_vchord;
187+
DROP TABLE test_vchord;
188+
SQL
189+
190+
echo "=== All extension smoke tests passed ==="
172191
173192
- name: Cleanup test container
174193
if: always()

0 commit comments

Comments
 (0)