Skip to content

Commit 045e12d

Browse files
committed
ci(e2e-report): fix workflow test results file path
The e2e-report site reads the data file from `e2e-report/data/test-results.json`. The CI workflow was downloading an artifact called `latest-test-results.json` into the right directory but without renaming it. We didn't notice for some time because we have a committed file at the expected, and we'd been regularly updating it while actively working on the e2e-report site. While I was at it, I made this a bit clearer and replaced the hardcoded Next.js version with a selector input.
1 parent 34276c9 commit 045e12d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/e2e-report.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
use-branch:
88
description: 'Enable if you want to test data from your selected branch instead of the scheduled test runs from Main'
99
type: boolean
10+
version:
11+
description: 'Version of Next.js (most recent test run must have included this version)'
12+
type: choice
13+
options:
14+
- 'latest'
15+
- 'canary'
16+
- '13.5.1'
17+
default: 'latest'
1018

1119
env:
1220
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
@@ -27,12 +35,16 @@ jobs:
2735
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e schedule -s success --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
2836
fi
2937
echo "runId=$E2E_RUN_ID" >> $GITHUB_OUTPUT
30-
- name: Download latest e2e results
38+
- name: Download e2e results
3139
if: ${{ steps.get-run-id.outputs.runId }}
3240
run: |
33-
echo "Downloading latest test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
34-
rm e2e-report/data/test-results.json
35-
gh run download ${{ steps.get-run-id.outputs.runId }} -n "latest-test-results.json" -D e2e-report/data/ --repo $GITHUB_REPOSITORY
41+
version="${{ inputs.version }}"
42+
version=${version:-latest}
43+
echo "Downloading ${version} test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
44+
artifact_name="${version}-test-results.json"
45+
# NOTE: The artifact name is not necessarily the artifact *file* name. The file name here
46+
# must be `test-results.json`.
47+
gh run download ${{ steps.get-run-id.outputs.runId }} -n "${artifact_name}" -D e2e-report/data/ --repo $GITHUB_REPOSITORY
3648
- name: Install site dependencies
3749
if: success()
3850
run: |

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ jobs:
259259
- name: Upload Test JSON
260260
uses: actions/upload-artifact@v4
261261
with:
262+
# TODO(serhalp) Consider renaming this. It's misleading, since it's just an identifier,
263+
# but it's formatted like a filename, and happens to be almost - but not quite - the
264+
# actual filename.
262265
name: ${{matrix.version_spec.selector}}-test-results.json
263266
path: report/test-results.json
264267

0 commit comments

Comments
 (0)