Skip to content

chore: add the Next.js e2e test suite #1782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Nov 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2e4d2a0
chore: all the tests
ascorbic Nov 16, 2022
1fada0c
chore: fix eslint
ascorbic Nov 16, 2022
119acea
chore: parallelise e2e tests
ascorbic Nov 16, 2022
56af7cd
chore: don't fail fast
ascorbic Nov 16, 2022
1b585b3
chore: unignore modules and use node-fetch
ascorbic Nov 16, 2022
6e21fb4
chore: very parallel
ascorbic Nov 16, 2022
8208c99
chore: don't mock fetch :facepalm:
ascorbic Nov 17, 2022
5a8e8e0
chore: remove disabled tests
ascorbic Nov 17, 2022
244feb9
chore: test with node 18
ascorbic Nov 17, 2022
b001fa2
chore: switchable fetch
ascorbic Nov 17, 2022
54c6dbd
chore: remove irrelevant tests
ascorbic Nov 17, 2022
a9bb106
chore: remove disabled test
ascorbic Nov 17, 2022
94922e4
chore: add reporter
ascorbic Nov 17, 2022
a83ec22
chore: no concurrency
ascorbic Nov 17, 2022
6da9677
chore: try to fix jest
ascorbic Nov 17, 2022
cd387b7
chore: fix test command
ascorbic Nov 17, 2022
a5d802f
chore: artifact file path
ascorbic Nov 17, 2022
40f82a0
chore: use site build command
ascorbic Nov 17, 2022
5deb9e4
chore: download artifacts
ascorbic Nov 17, 2022
1aefa22
chore: report per-chunk
ascorbic Nov 18, 2022
a1fb9fe
chore: update syntax
ascorbic Nov 18, 2022
1bad311
chore: report to summary
ascorbic Nov 18, 2022
1e8b82a
chore: do annotate
ascorbic Nov 18, 2022
8e738ac
chore: update and add summary
ascorbic Nov 18, 2022
04d85ba
chore: rearrange
ascorbic Nov 18, 2022
e59241d
chore: combine tests
ascorbic Nov 18, 2022
ea61bb9
chore: fix test
ascorbic Nov 18, 2022
5fd01b6
chore: rearrange and disable failing suites
ascorbic Nov 18, 2022
00f105f
chore: skip broken ntl and fail faster
ascorbic Nov 18, 2022
d0aaab4
chore: disable suite
ascorbic Nov 18, 2022
155bca9
chore: skip failing tests
ascorbic Nov 21, 2022
703443a
chore: add ability to run disabled tests
ascorbic Nov 21, 2022
8d82ad5
chore: add comments to workflow file
ascorbic Nov 21, 2022
b387a42
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 21, 2022
59f8aa2
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 22, 2022
5d0a5f3
chore: one worker per file
ascorbic Nov 22, 2022
d8f55d9
Merge branch 'mk/all-the-tests' of github.com:netlify/next-runtime in…
ascorbic Nov 22, 2022
8daf9a7
chore: oops
ascorbic Nov 22, 2022
585f940
chore: make path relative to test dir
ascorbic Nov 22, 2022
8d4e75e
chore: conditionally skip
ascorbic Nov 22, 2022
f0044fe
chore: enable middleware-responses test
ascorbic Nov 22, 2022
5c5a847
chore: run all tests once
ascorbic Nov 22, 2022
e4de44c
chore: don't run disabled tests
ascorbic Nov 22, 2022
f6a9699
fix: ensure responses are Responses
ascorbic Nov 22, 2022
3de3b89
chore: re-enable test
ascorbic Nov 22, 2022
7f0634f
chore: run all tests
ascorbic Nov 22, 2022
10d46de
chore: enable another suite
ascorbic Nov 22, 2022
5bf495e
fix: better headers.getAll polyfill
ascorbic Nov 22, 2022
cf52991
chore: enable middleware-redirects suite
ascorbic Nov 22, 2022
55141ed
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 22, 2022
62070b8
chore: conditionally enable req body tests
ascorbic Nov 22, 2022
bacd775
chore: disable failing tests
ascorbic Nov 22, 2022
f070c64
chore: add test readme doc
ascorbic Nov 23, 2022
4065399
chore: remove eslint changes
ascorbic Nov 23, 2022
0943236
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 23, 2022
cf61b0b
Merge branch 'main' into mk/all-the-tests
ascorbic Nov 23, 2022
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
78 changes: 68 additions & 10 deletions .github/workflows/e2e-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,77 @@ on:
branches: [main]

jobs:
setup:
runs-on: ubuntu-latest
outputs:
test-files: ${{ steps['set-test-files'].outputs['test-files'] }}
steps:
- uses: actions/checkout@v3
- run: npm install
- id: set-test-files
name: Get test files
# Extracts the list of all test files as JSON and trims to be relative to the test dir to be easier to read
run:
echo "test-files=$(npx jest -c test/e2e/jest.config.js --listTests --json | jq -cM 'map(.[env.PWD | length +
10:])')" >> $GITHUB_OUTPUT
# echo "test-files=$(npx jest -c test/e2e/jest.config.all.js --listTests --json | jq -cM 'map(.[env.PWD | length
# + 10:])')" >> $GITHUB_OUTPUT

test:
name: E2E tests
runs-on: ubuntu-latest
name: test (${{ matrix.test-file }})
needs:
- setup
strategy:
fail-fast: false
matrix:
# Creates a job for each chunk ID. This will be assigned one or more test files to run
test-file: ${{ fromJson(needs.setup.outputs['test-files']) }}
steps:
- uses: actions/checkout@v2
- name: Installing with LTS Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: NPM Install
run: npm install
- name: Run Next.js e2e test suite
run: npm run test:next
- uses: actions/checkout@v3
- run: npm install
- name: Run tests
run: npx jest --reporters=jest-junit --reporters=default -c test/e2e/jest.config.all.js ${{ matrix.test-file }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_BOT_AUTH_TOKEN }}
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
# RUN_SKIPPED_TESTS: true
# - uses: phoenix-actions/test-reporting@v10
# if: ${{ always() }}
# name: Report Test Results
# # Generates annotations for the test failures
# id: test-report
# with:
# name: E2E Test chunk ${{ matrix.chunk }}
# path: 'reports/**/*.xml' # Path to test results (inside artifact .zip)
# output-to: 'checks'
# max-annotations: 49 # Maximum number of annotations to be created
# reporter: jest-junit # Format of test results

- uses: actions/upload-artifact@v3
# upload test results
if: ${{ always() }}
name: Upload test results
with:
name: test-results
path: reports/jest-*.xml
report:
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- test
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: reports
- name: Combine reports
# The test reporter can handle multiple files, but these have random filenames so the output is better when combined
run: npx junit-report-merger test-results.xml reports/**/*.xml
- uses: phoenix-actions/test-reporting@v10
with:
name: Jest Tests
output-to: 'step-summary'
path: 'test-results.xml'
max-annotations: 49
reporter: jest-junit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,6 @@ packages/*/lib

# Cypress
cypress/screenshots

# Test cases have node module fixtures
!test/**/node_modules
Loading