Skip to content

Commit 5fea068

Browse files
author
Janne Rönkkö
committed
Add support for parallel E2E tests
1 parent ce0ea87 commit 5fea068

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

github-actions/run-ci/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,6 @@ runs:
144144
- name: Run e2e tests
145145
env:
146146
CYPRESS_TESTS_KEPT_IN_MEMORY: "${{ inputs.cypress_tests_kept_in_memory }}"
147-
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v3
147+
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@split-e2e
148148
with:
149149
test-tags: "${{ inputs.test-tags }}"

github-actions/run-cypress-tests/action.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,44 @@ runs:
2424
docker exec \
2525
-e TEST_TAGS="${{ inputs.test-tags }}" \
2626
-e TEST_VIDEO="${{ inputs.video }}" \
27+
-e SPLIT="${{ strategy.job-total }}" \
28+
-e SPLIT_INDEX="${{ strategy.job-index }}" \
29+
-e SPLIT_FXILE=timings.json \
30+
-e SPLIT_OUTPUT_FILE=timings.out.json \
2731
cypress /e2e/cypress/run_cypress_in_4K_xvfb.sh
32+
33+
docker exec cypress pwd
34+
docker exec cypress ls -lh /e2e
35+
docker exec cypress ls -lh /e2e/cypress
36+
docker exec cypress ls -lh /e2e/cypress/reports
2837
shell: bash
2938

3039
- name: Retrieve test reports from container
3140
# should be run even if the tests fail
3241
if: always()
3342
run: |
43+
echo '=================== LOCAL ==================='
44+
ls -lh
45+
ls -lh test-reports
46+
3447
docker cp cypress:/e2e/cypress/reports ${{ github.workspace }}/test-reports || echo "No reports"
48+
docker cp cypress:/e2e/cypress/timings.out.json ${{ github.workspace }}/timings.out.json || echo "No timings file"
3549
shell: bash
3650

3751
- name: Upload test reports as an artifact
3852
# should be run even if the tests fail
3953
if: always()
4054
uses: actions/upload-artifact@v4
4155
with:
42-
name: cypress-docker-reports
56+
name: "cypress-docker-report-${{ strategy.job-index }}-of-${{ strategy.job-total }}"
4357
path: ${{ github.workspace }}/test-reports
4458

59+
- name: Upload cypress-split timings file
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: "cypress-timings-${{ strategy.job-index }}-of-${{ strategy.job-total }}"
63+
path: ${{ github.workspace }}/timings.out.json
64+
4565
- name: Fail the job
4666
# should fail the job if the tests fail
4767
if: ${{ failure() }}

0 commit comments

Comments
 (0)