Add test postgres docker compose

This commit is contained in:
2025-03-06 21:40:16 +01:00
parent f55d2644c3
commit d8de67ae6c
2 changed files with 41 additions and 0 deletions

20
server/run_integration_tests.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
set -e
COMPOSE_FILE=docker-compose.test.yaml
if ! docker compose -f $COMPOSE_FILE ps postgres | grep -q "running"; then
docker compose -f $COMPOSE_FILE up -d
until docker compose -f $COMPOSE_FILE exec postgres pg_isready -U postgres; do
sleep 1
done
echo "PostgreSQL is ready!"
fi
export LEMMA_TEST_POSTGRES_URL="postgres://postgres:postgres@localhost:5432/lemma_test?sslmode=disable"
echo "Running integration tests..."
go test -v -tags=integration ./...
docker compose -f $COMPOSE_FILE down