diff --git a/.github/workflows/shared-run-e2e.yml b/.github/workflows/shared-run-e2e.yml index 0190332..6fba82a 100644 --- a/.github/workflows/shared-run-e2e.yml +++ b/.github/workflows/shared-run-e2e.yml @@ -213,6 +213,7 @@ jobs: docker cp e2e-test-durations.json cypress:/e2e/cypress/e2e-test-durations.json - name: Run the tests + id: run_tests shell: bash run: | docker exec \ @@ -280,6 +281,46 @@ jobs: name: cypress-docker-reports-${{ strategy.job-index }} path: ${{ github.workspace }}/test-reports + - name: Collect Docker container logs + id: collect_docker_logs + if: always() + shell: bash + run: | + mkdir -p ${{ github.workspace }}/docker-logs + + test_server_logs_exist=false + + while IFS= read -r container_name + do + # The Cypress container logs are already available via test report artifacts. + if [[ "${container_name}" == "cypress" ]] + then + continue + fi + + docker logs "${container_name}" > "${{ github.workspace }}/docker-logs/${container_name}.log" 2>&1 || true + + if [[ -s "${{ github.workspace }}/docker-logs/${container_name}.log" ]] + then + test_server_logs_exist=true + fi + done < <(docker ps --format '{{.Names}}') + + if [[ "${test_server_logs_exist}" == "true" ]] + then + echo "Logs for services:" + find ${{ github.workspace }}/docker-logs -type f + fi + + echo "test_server_logs_exist=${test_server_logs_exist}" >> $GITHUB_OUTPUT + + - name: Upload Docker server logs as an artifact + if: always() && steps.collect_docker_logs.outputs.test_server_logs_exist == 'true' + uses: actions/upload-artifact@v6 + with: + name: cypress-server-logs-${{ strategy.job-index }} + path: ${{ github.workspace }}/docker-logs + publish_e2e_test_results: name: Publish E2E Test Results runs-on: ubuntu-24.04 diff --git a/.github/workflows/test-setup-e2e-environment-action.yml b/.github/workflows/test-setup-e2e-environment-action.yml index 36e4050..c8c7a80 100644 --- a/.github/workflows/test-setup-e2e-environment-action.yml +++ b/.github/workflows/test-setup-e2e-environment-action.yml @@ -30,7 +30,7 @@ jobs: hastus-docker-image: "" custom-docker-compose: "" # overwrite some - - ui-docker-image: "hsldevcom/jore4-ui:latest" + - ui-docker-image: "crjore4prod001.azurecr.io/jore4-ui:latest" hasura-docker-image: "" auth-docker-image: "" mbtiles-docker-image: "" @@ -65,7 +65,7 @@ jobs: touch custom-compose.yml echo "services:" >> custom-compose.yml echo " jore4-hasura:" >> custom-compose.yml - echo " image: 'hsldevcom/jore4-hasura:latest'" >> custom-compose.yml + echo " image: 'crjore4prod001.azurecr.io/jore4-hsl-hasura:latest'" >> custom-compose.yml - name: start e2e env uses: ./github-actions/setup-e2e-environment @@ -103,13 +103,13 @@ jobs: docker compose file) run: | HASURA_DEPLOYED_VERSION=`docker inspect --format='{{.Config.Image}}' hasura` - if [[ "${{ matrix.custom-docker-compose }}" == "" && "$HASURA_DEPLOYED_VERSION" == "hsldevcom/jore4-hasura:latest" ]] + if [[ "${{ matrix.custom-docker-compose }}" == "" && "$HASURA_DEPLOYED_VERSION" == "crjore4prod001.azurecr.io/jore4-hsl-hasura:latest" ]] then echo "Error! The docker image version shouldn't have been overwritten!" exit 1 fi - if [[ "${{ matrix.custom-docker-compose }}" != "" && "$HASURA_DEPLOYED_VERSION" != "hsldevcom/jore4-hasura:latest" ]] + if [[ "${{ matrix.custom-docker-compose }}" != "" && "$HASURA_DEPLOYED_VERSION" != "crjore4prod001.azurecr.io/jore4-hsl-hasura:latest" ]] then echo "Error! The docker image version should've been overwritten!" exit 1