From 21d2476d9f5e39d83413e0ab7bb9a8304cf1a2ad Mon Sep 17 00:00:00 2001 From: "Al @h0lybyte" <5599058+h0lybyte@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:45:14 -0500 Subject: [PATCH] test: expand extension smoke tests with functional queries Add actual data operations for each KBVE extension beyond CREATE: - pgvector: insert vectors, test distance search - kilobase: call kilobase_info() - vchord: create table, bulk insert, verify row count Use ON_ERROR_STOP=1 to fail fast on any query error. --- .github/workflows/ci-kilobase-runner.yaml | 41 +++++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-kilobase-runner.yaml b/.github/workflows/ci-kilobase-runner.yaml index 8cc145d51..50392ec8b 100644 --- a/.github/workflows/ci-kilobase-runner.yaml +++ b/.github/workflows/ci-kilobase-runner.yaml @@ -158,17 +158,36 @@ jobs: - name: Test KBVE extensions run: | - echo "=== Test pgvector ===" - 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';" - - echo "=== Test kilobase ===" - 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';" - - echo "=== Test vchord ===" - 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';" - - echo "=== Verify all loaded ===" - 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;" + PSQL="docker exec pg-test-17 psql -U supabase_admin -h localhost -d postgres -v ON_ERROR_STOP=1" + + echo "=== Load extensions ===" + $PSQL -c "CREATE EXTENSION IF NOT EXISTS vector;" + $PSQL -c "CREATE EXTENSION kilobase;" + $PSQL -c "CREATE EXTENSION vchord;" + $PSQL -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('vector', 'kilobase', 'vchord') ORDER BY extname;" + + echo "=== Smoke test: pgvector ===" + $PSQL <<'SQL' + CREATE TABLE test_embeddings (id serial PRIMARY KEY, embedding vector(3)); + INSERT INTO test_embeddings (embedding) VALUES ('[1,2,3]'), ('[4,5,6]'), ('[7,8,9]'); + SELECT id, embedding, embedding <-> '[1,1,1]' AS distance FROM test_embeddings ORDER BY embedding <-> '[1,1,1]' LIMIT 2; + DROP TABLE test_embeddings; + SQL + + echo "=== Smoke test: kilobase ===" + $PSQL <<'SQL' + SELECT kilobase_info(); + SQL + + echo "=== Smoke test: vchord ===" + $PSQL <<'SQL' + CREATE TABLE test_vchord (id serial PRIMARY KEY, embedding vector(3)); + INSERT INTO test_vchord (embedding) SELECT ('[' || (random()*10)::int || ',' || (random()*10)::int || ',' || (random()*10)::int || ']')::vector FROM generate_series(1, 100); + SELECT COUNT(*) AS row_count FROM test_vchord; + DROP TABLE test_vchord; + SQL + + echo "=== All extension smoke tests passed ===" - name: Cleanup test container if: always()