15 lines
593 B
Bash
Executable File
15 lines
593 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Runs the package tests against SQLite and a throwaway postgres:17 container.
|
|
set -euo pipefail
|
|
PORT="${STC_PG_PORT:-55432}"
|
|
cd "$(dirname "$0")/.."
|
|
trap 'docker stop stc-pg >/dev/null 2>&1 || true' EXIT
|
|
docker rm -f stc-pg >/dev/null 2>&1 || true
|
|
docker run -d --rm --name stc-pg -e POSTGRES_PASSWORD=stc -p 127.0.0.1:${PORT}:5432 postgres:17 >/dev/null
|
|
for _ in $(seq 1 60); do
|
|
docker exec stc-pg pg_isready -U postgres -h 127.0.0.1 >/dev/null 2>&1 && break
|
|
sleep 1
|
|
done
|
|
sleep 1
|
|
STC_TEST_PG_URL="postgres://postgres:[email protected]:${PORT}/postgres" bun test packages
|