Skip to content

Commit 8d82ad5

Browse files
committed
chore: add comments to workflow file
1 parent 703443a commit 8d82ad5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/e2e-next.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ jobs:
1616
- run: npm install
1717
- id: set-test-chunks
1818
name: Set Chunks
19+
# Extracts the list of all test files, then uses js to split them into groups to allocate to each worker. The JSON is sent to the job output
1920
run:
2021
echo "test-chunks=$(npx jest -c test/e2e/jest.config.js --listTests --json | jq -cM '[_nwise(length / 24 |
2122
floor)]')" >> $GITHUB_OUTPUT
2223

2324
- id: set-test-chunk-ids
2425
name: Set Chunk IDs
26+
# Extracts the chunk IDs from the JSON output and sends them to the job output. These will just be a sequence of array indices
2527
run: echo "test-chunk-ids=$(echo $CHUNKS | jq -cM 'to_entries | map(.key)')" >> $GITHUB_OUTPUT
2628
env:
2729
CHUNKS: ${{ steps['set-test-chunks'].outputs['test-chunks'] }}
@@ -33,6 +35,7 @@ jobs:
3335
strategy:
3436
fail-fast: false
3537
matrix:
38+
# Creates a job for each chunk ID. This will be assinged one or more test files to run
3639
chunk: ${{ fromJson(needs.setup.outputs['test-chunk-ids']) }}
3740
steps:
3841
- uses: actions/checkout@v3
@@ -44,6 +47,7 @@ jobs:
4447
check-latest: true
4548
- name: Run tests
4649
run:
50+
# Gets the list of test files for the current chunk ID and runs them, saving the results as a JUnit XML file
4751
echo $CHUNKS | jq '.[${{ matrix.chunk }}] | .[] | @text' | xargs npx jest --reporters=jest-junit
4852
--reporters=default -c test/e2e/jest.config.js
4953
env:
@@ -53,6 +57,7 @@ jobs:
5357
- uses: phoenix-actions/test-reporting@v10
5458
if: ${{ always() }}
5559
name: Report Test Results
60+
# Generates annotations for the test failures
5661
id: test-report
5762
with:
5863
name: E2E Test chunk ${{ matrix.chunk }}
@@ -61,7 +66,8 @@ jobs:
6166
max-annotations: 49 # Maximum number of annotations to be created
6267
reporter: jest-junit # Format of test results
6368

64-
- uses: actions/upload-artifact@v3 # upload test results
69+
- uses: actions/upload-artifact@v3
70+
# upload test results
6571
if: ${{ always() }}
6672
with:
6773
name: test-results-${{ matrix.chunk }}
@@ -78,10 +84,12 @@ jobs:
7884
path: reports
7985
- name: Combine reports
8086
run: npx junit-report-merger combined.xml reports/**/*.xml
87+
# The test reporter can handle multiple files, but these are arbitrary chunks and combining them gives more useful results
8188
- uses: phoenix-actions/test-reporting@v10
8289
with:
8390
name: Jest Tests
8491
output-to: 'step-summary'
8592
path: 'combined.xml'
86-
max-annotations: 0 # Annotations were done in the test steps
93+
# Annotations were done in the test steps. This is just the summary
94+
max-annotations: 0
8795
reporter: jest-junit

0 commit comments

Comments
 (0)