ci(fa02): simplify disposable PostgreSQL fixture SQL for strict restore verification [skip ci]

This commit is contained in:
victorsteele428 committed 2026-11-24 03:00:24 +00:00
1 parent ab21605591
commit 6098076608
1 file changed
+3 -3
+3 -3
View File
@@ -253,13 +253,13 @@ jobs:
done
echo DATASTACK_DISPOSABLE_FIVE_SERVICE_HEALTH_PASS
# Disposable PostgreSQL backup and restore into a second, isolated database.
compose exec -T postgres sh -c 'psql -q -U datastack "$POSTGRES_DB" -v ON_ERROR_STOP=1 -c "CREATE TABLE fa02_disposable_fixture (id integer PRIMARY KEY, message text NOT NULL); INSERT INTO fa02_disposable_fixture VALUES (1, '\''test-only'\'');"'
compose exec -T postgres sh -c 'psql -q -U datastack "$POSTGRES_DB" -v ON_ERROR_STOP=1 -c "CREATE TABLE fa02_disposable_fixture (id integer PRIMARY KEY); INSERT INTO fa02_disposable_fixture VALUES (4242);"'
compose exec -T postgres sh -c 'pg_dump -U datastack "$POSTGRES_DB"' > "$testdir/pg.sql"
test -s "$testdir/pg.sql"
compose exec -T postgres createdb -U datastack fa02_disposable_restore
compose exec -T postgres psql -q -v ON_ERROR_STOP=1 -U datastack -d fa02_disposable_restore < "$testdir/pg.sql"
restored="$(compose exec -T postgres psql -At -U datastack -d fa02_disposable_restore -c 'SELECT message FROM fa02_disposable_fixture WHERE id = 1')"
test "$restored" = test-only
restored="$(compose exec -T postgres psql -At -U datastack -d fa02_disposable_restore -c 'SELECT id FROM fa02_disposable_fixture WHERE id = 4242')"
test "$restored" = 4242
echo DATASTACK_DISPOSABLE_POSTGRES_BACKUP_RESTORE_PASS
# Redis AOF and CSV storage fixtures: no user/production records.
compose exec -T redis redis-cli SET fa02:disposable:probe stable-fixture >/dev/null