test(ci): register RM-61 terminal-green contract cases
This commit is contained in:
+4
-25
@@ -125,19 +125,10 @@ steps:
|
||||
echo "ci-postgres did not become ready" >&2
|
||||
exit 1
|
||||
fi
|
||||
# RM-61 negative control 2/2: arm a real post-readiness database crash,
|
||||
# then continuously query until the service loss is observed.
|
||||
- psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -c 'CREATE TABLE rm61_crash_armed (armed boolean NOT NULL)'
|
||||
- |
|
||||
for i in $(seq 1 60); do
|
||||
if ! psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -c 'SELECT 1'; then
|
||||
echo "RM-61 control observed the armed PostgreSQL crash" >&2
|
||||
exit 61
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
echo "RM-61 control did not observe the armed PostgreSQL crash" >&2
|
||||
exit 62
|
||||
# Run migrations (DATABASE_URL is set in environment above)
|
||||
- pnpm --filter @mosaicstack/db run db:migrate
|
||||
# Run all tests
|
||||
- pnpm test
|
||||
depends_on:
|
||||
- typecheck
|
||||
|
||||
@@ -148,15 +139,3 @@ services:
|
||||
POSTGRES_USER: mosaic
|
||||
POSTGRES_PASSWORD: mosaic
|
||||
POSTGRES_DB: mosaic
|
||||
PGPASSWORD: mosaic
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
docker-entrypoint.sh postgres &
|
||||
postgres_pid=$$!
|
||||
until pg_isready -h 127.0.0.1 -p 5432 -U mosaic; do sleep 1; done
|
||||
until [ "$$(psql -h 127.0.0.1 -U mosaic -d mosaic -Atqc "SELECT to_regclass('public.rm61_crash_armed')")" = "rm61_crash_armed" ]; do sleep 1; done
|
||||
echo "RM-61 control killing ready PostgreSQL postmaster $$postgres_pid" >&2
|
||||
kill -KILL "$$postgres_pid"
|
||||
wait "$$postgres_pid"
|
||||
|
||||
Reference in New Issue
Block a user