From 1648ad40421820513470f917795ef498bfc9a400 Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Mon, 7 Jul 2025 15:30:29 +0000 Subject: [PATCH] add healthcheck to playwright tests to wait for Mealie to be ready (not sure we need this) --- .github/workflows/e2e.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 07fd7adfc..ebf71bf49 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -44,6 +44,22 @@ jobs: run: yarn playwright install --with-deps - name: Check test environment run: docker ps + - name: Wait for application to be ready + run: | + echo "Waiting for Mealie to be ready..." + for i in {1..60}; do + if curl -f http://localhost:9000/login/ >/dev/null 2>&1; then + echo "Mealie is ready!" + break + fi + if [ $i -eq 60 ]; then + echo "Timeout waiting for Mealie to be ready" + docker logs mealie + exit 1 + fi + echo "Attempt $i/60: Mealie not ready yet, waiting 2 seconds..." + sleep 2 + done - name: Run Playwright tests run: yarn playwright test - name: Destroy Test Environment