feat: Add comprehensive test suite and cleanup step
All checks were successful
🚀 Docker Build and Push / build-and-push (15) (push) Successful in 5m54s
🚀 Docker Build and Push / build-and-push (16) (push) Successful in 6m0s
🚀 Docker Build and Push / build-and-push (17) (push) Successful in 5m56s
🚀 Docker Build and Push / build-and-push (18) (push) Successful in 6m4s

- Split validation into 4 granular CI steps (Config, Timescale, Vector, Hybrid)
- Added cleanup step for Docker images in CI
- Created SQL test scripts in tests/ for robustness
This commit is contained in:
2025-12-19 12:51:17 +01:00
parent 4ea4132653
commit df585b765a
5 changed files with 137 additions and 23 deletions

View File

@@ -51,30 +51,23 @@ jobs:
sleep 2
done
- name: 🧪 Test image - Verify extensions
- name: ⚙️ Setup Tests
run: |
# Wait a bit more for init scripts to complete
sleep 5
# Check extensions are installed
RESULT=$(docker exec test-pg${{ matrix.pg_version }} psql -U postgres -t -c \
"SELECT count(*) FROM pg_extension WHERE extname IN ('timescaledb', 'vector', 'vchord');")
EXTENSIONS=$(echo $RESULT | tr -d ' ')
echo "Found $EXTENSIONS extensions"
if [ "$EXTENSIONS" -eq "3" ]; then
echo "✅ All 3 extensions are installed!"
else
echo "❌ Expected 3 extensions, found $EXTENSIONS"
docker exec test-pg${{ matrix.pg_version }} psql -U postgres -c \
"SELECT extname, extversion FROM pg_extension;"
exit 1
fi
# Show extension versions
docker exec test-pg${{ matrix.pg_version }} psql -U postgres -c \
"SELECT extname, extversion FROM pg_extension WHERE extname IN ('timescaledb', 'vector', 'vchord');"
# Wait for valid startup
sleep 10
docker cp tests/ test-pg${{ matrix.pg_version }}:/tmp/tests/
- name: "🧪 Test 1: Configuration"
run: docker exec test-pg${{ matrix.pg_version }} psql -U postgres -f /tmp/tests/test-1-config.sql
- name: "🧪 Test 2: TimescaleDB"
run: docker exec test-pg${{ matrix.pg_version }} psql -U postgres -f /tmp/tests/test-2-timescale.sql
- name: "🧪 Test 3: VectorChord"
run: docker exec test-pg${{ matrix.pg_version }} psql -U postgres -f /tmp/tests/test-3-vector.sql
- name: "🧪 Test 4: Hybrid Scenarios"
run: docker exec test-pg${{ matrix.pg_version }} psql -U postgres -f /tmp/tests/test-4-hybrid.sql
- name: 🧹 Cleanup test container
if: always()
@@ -101,4 +94,10 @@ jobs:
tags: |
gitea.killinger.fr/maxime.killinger/postgres-ts-vectors:latest
- name: 🧹 Cleanup Docker images
if: always()
run: |
docker rmi postgres-ts-vectors:pg${{ matrix.pg_version }}-test || true
docker image prune -f