Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+57
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
# Exercises the identity/invite migration against clean and legacy fixtures.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
CONTAINER_ID=""
|
||||
POSTGRES_USER="identity_fixture"
|
||||
POSTGRES_PASSWORD="identity_fixture"
|
||||
POSTGRES_DB="identity_fixture"
|
||||
POSTGRES_IMAGE="${IDENTITY_INVITE_MIGRATION_PG_IMAGE:-postgres:16-alpine}"
|
||||
|
||||
require_cmd() {
|
||||
if ! command -v "$1" >/dev/null 2>&1; then
|
||||
echo "MISSING $1: the identity/invite migration fixture requires it" >&2
|
||||
exit 127
|
||||
fi
|
||||
}
|
||||
|
||||
require_cmd docker
|
||||
require_cmd pnpm
|
||||
|
||||
cleanup() {
|
||||
if [[ -n "$CONTAINER_ID" ]]; then
|
||||
docker rm -f "$CONTAINER_ID" >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
CONTAINER_ID="$(docker run -d \
|
||||
-p 127.0.0.1::5432 \
|
||||
-e POSTGRES_USER="$POSTGRES_USER" \
|
||||
-e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \
|
||||
-e POSTGRES_DB="$POSTGRES_DB" \
|
||||
"$POSTGRES_IMAGE")"
|
||||
|
||||
PORT="$(docker port "$CONTAINER_ID" 5432/tcp | awk -F: 'NR == 1 { print $NF }')"
|
||||
DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@127.0.0.1:${PORT}/${POSTGRES_DB}?schema=public"
|
||||
|
||||
# A cold postgres:16-alpine init exceeded 30 seconds under parallel runner I/O.
|
||||
# Keep the probe fail-closed, but give initialization the same bounded headroom
|
||||
# as the other database fixtures instead of racing a healthy startup.
|
||||
for attempt in $(seq 1 90); do
|
||||
if docker exec "$CONTAINER_ID" pg_isready -h 127.0.0.1 -U "$POSTGRES_USER" -d "$POSTGRES_DB" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
if [[ "$attempt" == "90" ]]; then
|
||||
echo "FAIL PostgreSQL did not become ready" >&2
|
||||
docker logs "$CONTAINER_ID" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
IDENTITY_INVITE_MIGRATION_TEST_DATABASE_URL="$DATABASE_URL" \
|
||||
pnpm exec vitest run packages/db/src/identity-invite-invariants-migration.test.ts
|
||||
|
||||
echo "PASS identity/invite clean-deploy, legacy-upgrade, and concurrency fixture"
|
||||
Reference in new issue
Block a user