Skip to content

Commit

Permalink
ci(e2e-report): fix workflow test results file path
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
serhalp committed Jul 9, 2024
1 parent 044fc00 commit ae2d3f2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/e2e-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
use-branch:
description: 'Enable if you want to test data from your selected branch instead of the scheduled test runs from Main'
type: boolean
version:
description: 'Version of Next.js (most recent test run must have included this version)'
type: choice
options:
- 'latest'
- 'canary'
- '13.5.1'
default: 'latest'

env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
Expand All @@ -27,12 +35,15 @@ jobs:
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e schedule -s success --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
fi
echo "runId=$E2E_RUN_ID" >> $GITHUB_OUTPUT
- name: Download latest e2e results
- name: Download e2e results
if: ${{ steps.get-run-id.outputs.runId }}
run: |
echo "Downloading latest test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
rm e2e-report/data/test-results.json
gh run download ${{ steps.get-run-id.outputs.runId }} -n "latest-test-results.json" -D e2e-report/data/ --repo $GITHUB_REPOSITORY
version="${{ inputs.version }}"
version=${version:-latest}
echo "Downloading ${version} test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
artifact_name="${version}-test-results.json"
gh run download ${{ steps.get-run-id.outputs.runId }} -n "${artifact_name}" --repo $GITHUB_REPOSITORY
mv "${artifact_name}" e2e-report/data/test-results.json
- name: Install site dependencies
if: success()
run: |
Expand Down

0 comments on commit ae2d3f2

Please sign in to comment.