Skip to content

Commit 9702ab2

Browse files
ascorbicLukas Holzerlukasholzer
authoredJan 19, 2024
ci: don't retry e2e tests (#179)
* ci: don't retry e2e tests * chore: fix integration tests on ci * chore: get rid of prepare fixtures on ci * chore: fix condition * chore: update --------- Co-authored-by: Lukas Holzer <lukas.holzer@netlify.com> Co-authored-by: Lukas Holzer <lukas.holzer@typeflow.cc>
1 parent b874afc commit 9702ab2

File tree

9 files changed

+315
-10
lines changed

9 files changed

+315
-10
lines changed
 

‎.eslintrc.cjs

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ module.exports = {
2323
'promise/catch-or-return': 'off',
2424
'promise/always-return': 'off',
2525
'max-nested-callbacks': 'off',
26+
'max-statements': 'off',
27+
'require-await': 'off',
2628
'no-inline-comments': 'off',
2729
'line-comment-position': 'off',
2830
'max-lines': 'off',

‎.github/workflows/run-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
fail-fast: false
6161
matrix:
62-
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
62+
shard: [1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8]
6363
steps:
6464
- uses: actions/checkout@v4
6565
- name: 'Install Node'

‎.github/workflows/test-e2e.yml

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ jobs:
131131
env:
132132
NODE_ENV: production
133133
NEXT_EXTERNAL_TESTS_FILTERS: ../next-runtime-minimal/tests/netlify-e2e.json
134+
NEXT_TEST_SKIP_RETRY_MANIFEST: ../next-runtime-minimal/tests/e2e-skip-retry.json
134135
run: node run-tests.js -g ${{ matrix.group }}/12 -c ${TEST_CONCURRENCY} --type e2e
135136
working-directory: ${{ env.next-path }}
136137

‎tests/e2e-skip-retry.json

+258
Large diffs are not rendered by default.

‎tests/fixtures/server-components/package-lock.json

+31-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/fixtures/server-components/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"react-dom": "18.2.0"
1414
},
1515
"devDependencies": {
16-
"@types/react": "18.2.34"
16+
"@types/node": "^20.11.5",
17+
"@types/react": "18.2.34",
18+
"typescript": "^5.3.3"
1719
}
1820
}

‎tests/netlify-e2e.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@
135135
"flakey": [
136136
"app-dir action handling should handle actions correctly after following a relative link"
137137
]
138+
},
139+
"test/e2e/middleware-general/test/index.test.ts": {
140+
"flakey": [
141+
"Middleware Runtime with i18n should redirect the same for direct visit and client-transition",
142+
"Middleware Runtime without i18n should redirect the same for direct visit and client-transition"
143+
]
144+
},
145+
"test/e2e/prerender.test.ts": {
146+
"flakey": ["Prerender should handle on-demand revalidate for fallback: blocking"]
138147
}
139148
},
140149
"rules": {
@@ -180,7 +189,8 @@
180189
"test/e2e/transpile-packages/index.test.ts",
181190
"test/e2e/typescript-version-no-warning/typescript-version-no-warning.test.ts",
182191
"test/e2e/typescript-version-warning/typescript-version-warning.test.ts",
183-
"test/e2e/app-dir/app/useReportWebVitals.test.ts"
192+
"test/e2e/app-dir/app/useReportWebVitals.test.ts",
193+
"test/e2e/app-dir/app-static/app-static-custom-handler.test.ts"
184194
]
185195
}
186196
}

‎tests/utils/fixture.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ const eszipHelper = join(actualCwd, 'tools/deno/eszip.ts')
4747

4848
function installDependencies(cwd: string) {
4949
if (existsSync(join(cwd, 'pnpm-lock.yaml'))) {
50-
return execaCommand('pnpm install --ignore-scripts --reporter=silent', {
50+
return execaCommand(`pnpm install --ignore-scripts --reporter=silent`, {
5151
cwd,
5252
})
5353
}
54-
return execaCommand('npm install --ignore-scripts --no-audit --progress=false', { cwd })
54+
return execaCommand(`npm install --ignore-scripts --no-audit --progress=false`, { cwd })
5555
}
5656

5757
/**

‎vitest.config.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { relative } from 'node:path'
2+
23
import { defineConfig } from 'vitest/config'
3-
import { W } from 'vitest/dist/reporters-5f784f42'
4-
import { BaseSequencer } from 'vitest/node'
4+
import { BaseSequencer, WorkspaceSpec } from 'vitest/node'
55

66
/**
77
* Tests that might influence others and should run on an isolated executor (shard)
@@ -11,10 +11,11 @@ const RUN_ISOLATED = new Set([
1111
'tests/integration/fetch-handler.test.ts',
1212
'tests/integration/revalidate-path.test.ts',
1313
'tests/integration/cache-handler.test.ts',
14+
'tests/integration/edge-handler.test.ts',
1415
])
1516

1617
class Sequencer extends BaseSequencer {
17-
async shard(projects: W[]): Promise<W[]> {
18+
async shard(projects: WorkspaceSpec[]): Promise<WorkspaceSpec[]> {
1819
const {
1920
config: { shard: { index = 1, count = 1 } = {} },
2021
} = this.ctx
@@ -68,9 +69,10 @@ export default defineConfig({
6869
unstubEnvs: true,
6970
unstubGlobals: true,
7071
environment: 'node',
71-
testTimeout: 100000,
72+
testTimeout: 100_000,
7273
setupFiles: ['tests/test-setup.ts'],
7374
logHeapUsage: true,
75+
hookTimeout: 50_000,
7476
sequence: {
7577
sequencer: Sequencer,
7678
},

0 commit comments

Comments
 (0)
Please sign in to comment.