forked from mtusi2026/mtusi2026lab2
ЛР 2: PostgreSQL, сессии, Redis и исследование
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
base_url="${BASE_URL:-http://localhost:8080}"
|
||||
python="${PYTHON:-python3}"
|
||||
|
||||
restore() {
|
||||
docker compose up -d --no-deps --force-recreate api >/dev/null
|
||||
}
|
||||
trap restore EXIT
|
||||
|
||||
SESSION_TTL_SECONDS=2 docker compose up -d --no-deps --force-recreate api >/dev/null
|
||||
|
||||
attempt=0
|
||||
until curl --fail --silent "$base_url/health/ready" >/dev/null; do
|
||||
attempt=$((attempt + 1))
|
||||
if [ "$attempt" -ge 30 ]; then
|
||||
printf '%s\n' 'API did not become ready for expiry test.' >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
|
||||
"$python" student-tests/lab2_tests.py --base-url "$base_url" --check-expiry
|
||||
Reference in New Issue
Block a user