Skip to content

Commit

Permalink
Improve startup time for Playwright tests, fix report path.
Browse files Browse the repository at this point in the history
Signed-off-by: Zachary Licastro <[email protected]>
  • Loading branch information
CheesyLaZanya committed Oct 5, 2024
1 parent 5d71940 commit dcf9330
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ jobs:
if: always()
with:
name: playwright-report
path: playwright-report/
path: modules/odr_frontend/playwright-report/
retention-days: 7
23 changes: 22 additions & 1 deletion run-playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,28 @@ set -e

task dev &
echo "Waiting for services to start..."
sleep 300

# Maximum wait time in seconds
max_wait=300
check_interval=5
start_time=$(date +%s)

while true; do
if docker compose logs | grep -q "INFO: Application startup complete."; then
echo "Services started successfully."
break
fi

current_time=$(date +%s)
elapsed=$((current_time - start_time))

if [ $elapsed -ge $max_wait ]; then
echo "Timeout: Services did not start within $max_wait seconds."
exit 1
fi

sleep $check_interval
done

cd modules/odr_frontend
npx playwright test
Expand Down

0 comments on commit dcf9330

Please sign in to comment.