test: stabilize e2e auth and rate limits

This commit is contained in:
Adrian Acala
2026-01-18 21:22:03 -08:00
parent 15ac634d15
commit 260a898e3e
13 changed files with 250 additions and 79 deletions
+9
View File
@@ -25,6 +25,15 @@ if [ -f "/app/prisma/dev.db" ]; then
chmod 666 /app/prisma/dev.db
fi
# Optionally reset the database (used for E2E runs)
if [ "${RESET_DB_ON_START}" = "true" ]; then
DB_PATH="${DATABASE_URL#file:}"
if [ "$DB_PATH" != "$DATABASE_URL" ]; then
echo "Resetting database at ${DB_PATH}..."
rm -f "${DB_PATH}" "${DB_PATH}-journal" "${DB_PATH}-wal" "${DB_PATH}-shm"
fi
fi
# 3. Run Migrations (Drop privileges to nodejs)
echo "Running database migrations..."
su-exec nodejs npx prisma migrate deploy