Enhance Jenkinsfile for frontend testing and update Playwright configuration
- Added a new 'E2E (docker compose + Playwright)' stage in the Jenkinsfile to run end-to-end tests using Docker Compose and Playwright. - Updated the 'Test frontend' stage to utilize the Playwright test image and improved error handling for missing files. - Modified Playwright configuration to use an environment variable for the base URL, enhancing flexibility in CI environments. - Expanded TypeScript configuration to include additional test and configuration files for better type checking.
This commit is contained in:
31
scripts/wait-for-jenkins-stack.sh
Executable file
31
scripts/wait-for-jenkins-stack.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# Espera API y Vite levantados en el host (tras docker compose), para E2E en CI.
|
||||
set -euo pipefail
|
||||
BACKEND_MAX_SEC="${BACKEND_MAX_SEC:-600}"
|
||||
FRONTEND_MAX_SEC="${FRONTEND_MAX_SEC:-300}"
|
||||
i=0
|
||||
while true; do
|
||||
if curl -fsS "http://localhost:8000/api/health" >/dev/null 2>&1; then
|
||||
echo "== stack: backend listo =="
|
||||
break
|
||||
fi
|
||||
i=$((i + 2))
|
||||
if [ "$i" -ge "$BACKEND_MAX_SEC" ]; then
|
||||
echo "ERROR: timeout esperando http://localhost:8000/api/health (${BACKEND_MAX_SEC}s)"
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
i=0
|
||||
while true; do
|
||||
if curl -fsS "http://localhost:5173/" >/dev/null 2>&1; then
|
||||
echo "== stack: frontend listo =="
|
||||
exit 0
|
||||
fi
|
||||
i=$((i + 2))
|
||||
if [ "$i" -ge "$FRONTEND_MAX_SEC" ]; then
|
||||
echo "ERROR: timeout esperando http://localhost:5173/ (${FRONTEND_MAX_SEC}s)"
|
||||
exit 1
|
||||
fi
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user