init
This commit is contained in:
42
test-with-logs.sh
Executable file
42
test-with-logs.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to watch logs and run Playwright tests
|
||||
|
||||
echo "=== Starting log watchers and Playwright tests ==="
|
||||
echo ""
|
||||
|
||||
# Function to cleanup background processes
|
||||
cleanup() {
|
||||
echo ""
|
||||
echo "=== Cleaning up ==="
|
||||
kill $BACKEND_LOG_PID $FRONTEND_LOG_PID 2>/dev/null
|
||||
exit
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
# Start watching backend logs in background
|
||||
echo "Watching backend logs..."
|
||||
podman logs -f paragliding-backend 2>&1 | while IFS= read -r line; do
|
||||
echo "[BACKEND] $line"
|
||||
done &
|
||||
BACKEND_LOG_PID=$!
|
||||
|
||||
# Start watching frontend logs in background
|
||||
echo "Watching frontend logs..."
|
||||
podman logs -f paragliding-frontend 2>&1 | while IFS= read -r line; do
|
||||
echo "[FRONTEND] $line"
|
||||
done &
|
||||
FRONTEND_LOG_PID=$!
|
||||
|
||||
# Wait a moment for log watchers to start
|
||||
sleep 2
|
||||
|
||||
# Run Playwright tests
|
||||
echo ""
|
||||
echo "=== Running Playwright tests ==="
|
||||
echo ""
|
||||
cd frontend && npx playwright test tests/interactive.spec.ts --headed
|
||||
|
||||
# Tests will complete and cleanup will run
|
||||
|
||||
Reference in New Issue
Block a user