From 7a75780c27c0eb8f5b2f1567c880817fa9f6ee2b Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Mon, 13 Jan 2025 16:14:30 +0100 Subject: [PATCH] Tests - Better log output in case of error --- .github/workflows/e2e_tests.yml | 38 ++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index 79f053adf8..c6d95307ac 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -95,26 +95,29 @@ jobs: - name: Build and start docker images run: ./run-docker up --build -d - - name: Wait docker images ready and install Lizmap + - name: Wait 30 secondes for docker images to be ready run: | sleep 30 - ./lizmap-ctl install - - name: Load SQL data + - name: Install Lizmap run: | - cd qgis-projects/tests - ./load_sql.sh - - - name: Add hosts to /etc/hosts - run: | - sudo echo "127.0.0.1 othersite.local" | sudo tee -a /etc/hosts + ./lizmap-ctl install - - name: Check about QGIS Server status + - name: Wait and check about QGIS Server status run: | - qgis_server_info=$(curl --user 'admin:admin' -s "http://localhost:8130/index.php/view/app/metadata" | jq --raw-output '.qgis_server_info.error') - if [[ "$qgis_server_info" != "null" ]]; then + curl \ + --user 'admin:admin' \ + --retry 30 \ + --retry-delay 5 \ + -vN \ + "http://localhost:8130/index.php/view/app/metadata" \ + -o /tmp/test-qgis-server.json + cat /tmp/test-qgis-server.json + qgis_info=$(cat /tmp/test-qgis-server.json | jq --raw-output '.qgis_server_info.error') + if [[ "$qgis_info" != "null" ]]; then echo "QGIS Server is not well configured" - exit 1 + echo "::warning QGIS Server was not up" + # exit 1 fi - name: Check about updated files after a build (PHP or JS) @@ -127,6 +130,15 @@ jobs: echo "::warning Git status is not clean" fi + - name: Load SQL data + run: | + cd qgis-projects/tests + ./load_sql.sh + + - name: Add hosts to /etc/hosts + run: | + sudo echo "127.0.0.1 othersite.local" | sudo tee -a /etc/hosts + # Playwright - uses: actions/setup-node@v4 with: