Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/shared-run-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-setup-e2e-environment-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down