Skip to content

Commit 8c8faa0

Browse files
ascorbicpieh
andauthored
chore: annotate all skipped tests (#378)
* chore: annotate all skipped tests * chore: generate test config from JSON file * chore: generate JSON results * chore: more annotation * chore: add more test explanations * chore: more test config * chore: more test config * chore: use reason --------- Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
1 parent e82e984 commit 8c8faa0

File tree

4 files changed

+599
-216
lines changed

4 files changed

+599
-216
lines changed

.github/workflows/test-e2e.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,12 @@ jobs:
241241
echo "slackEvent<<NETLIFY_EOF" >> $GITHUB_OUTPUT
242242
deno run -A tools/deno/junit2slack.ts --dir artifacts --version ${{matrix.version}} --runUrl ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}} >> $GITHUB_OUTPUT
243243
echo "NETLIFY_EOF" >> $GITHUB_OUTPUT
244-
244+
deno run -A tools/deno/junit2json.ts artifacts > report/test-results.json
245+
- name: Upload Test JSON
246+
uses: actions/upload-artifact@v4
247+
with:
248+
name: ${{matrix.version}}-test-results.json
249+
path: report/test-results.json
245250
- name: Notify Slack
246251
if: success() || failure()
247252
uses: slackapi/slack-github-action@v1.24.0

tests/netlify-e2e.cjs

+24-215
Original file line numberDiff line numberDiff line change
@@ -1,220 +1,29 @@
1-
module.exports = {
1+
// @ts-check
2+
const config = {
23
version: 2,
3-
suites: {
4-
'test/e2e/app-dir/app-static/app-static.test.ts': {
5-
failed: ['app-dir static/dynamic handling should warn for too many cache tags'],
6-
},
7-
'test/e2e/app-dir/headers-static-bailout/headers-static-bailout.test.ts': {
8-
failed: [
9-
// Uses cli output
10-
'headers-static-bailout it provides a helpful link in case static generation bailout is uncaught',
11-
],
12-
},
13-
'test/e2e/app-dir/parallel-routes-and-interception/parallel-routes-and-interception.test.ts': {
14-
failed: [],
15-
flakey: [
16-
// Uses patch file
17-
'parallel-routes-and-interception parallel routes should gracefully handle when two page segments match the `children` parallel slot',
18-
],
19-
},
20-
'test/e2e/opentelemetry/opentelemetry.test.ts': {
21-
failed: [
22-
'opentelemetry root context app router should handle RSC with fetch',
23-
'opentelemetry incoming context propagation app router should handle RSC with fetch',
24-
'opentelemetry incoming context propagation app router should handle route handlers in app router',
25-
],
26-
},
27-
'test/e2e/app-dir/rsc-basic/rsc-basic.test.ts': {
28-
failed: [
29-
'app dir - rsc basics should render initial styles of css-in-js in edge SSR correctly',
30-
'app dir - rsc basics should render initial styles of css-in-js in nodejs SSR correctly',
31-
'app dir - rsc basics should render server components correctly',
32-
],
33-
flakey: [
34-
'app dir - rsc basics react@experimental should opt into the react@experimental when enabling ppr',
35-
'app dir - rsc basics react@experimental should opt into the react@experimental when enabling taint',
36-
],
37-
},
38-
'test/e2e/app-dir/navigation/navigation.test.ts': {
39-
failed: [
40-
'app dir - navigation redirect status code should respond with 308 status code if permanent flag is set',
41-
'app dir - navigation redirect status code should respond with 307 status code in client component',
42-
'app dir - navigation redirect status code should respond with 307 status code in server component',
43-
'app dir - navigation bots should block rendering for bots and return 404 status',
44-
'app dir - navigation navigation between pages and app should not continously initiate a mpa navigation to the same URL when router state changes',
45-
],
46-
},
47-
'test/production/app-dir/unexpected-error/unexpected-error.test.ts': {
48-
failed: [
49-
'unexpected-error should set response status to 500 for unexpected errors in ssr app route',
50-
'unexpected-error should set response status to 500 for unexpected errors in isr app route',
51-
],
52-
},
53-
'test/e2e/skip-trailing-slash-redirect/index.test.ts': {
54-
flakey: [
55-
'skip-trailing-slash-redirect should merge cookies from middleware and API routes correctly',
56-
'skip-trailing-slash-redirect should merge cookies from middleware and edge API routes correctly',
57-
'skip-trailing-slash-redirect should handle external rewrite correctly /chained-rewrite-ssr',
58-
'skip-trailing-slash-redirect should handle external rewrite correctly /chained-rewrite-static',
59-
'skip-trailing-slash-redirect should handle external rewrite correctly /chained-rewrite-ssg',
60-
],
61-
},
62-
'test/e2e/module-layer/index.test.ts': {
63-
flakey: [
64-
'module layer no server-only in server targets should render routes marked with restriction marks without errors',
65-
'module layer with server-only in server targets should render routes marked with restriction marks without errors',
66-
],
67-
},
68-
'test/e2e/getserversideprops/test/index.test.ts': {
69-
flakey: [
70-
'getServerSideProps should set default caching header',
71-
'getServerSideProps should respect custom caching header',
72-
],
73-
},
74-
'test/e2e/app-dir/metadata-dynamic-routes/index.test.ts': {
75-
pending: [],
76-
flakey: [
77-
'app dir - metadata dynamic routes text routes should handle robots.[ext] dynamic routes',
78-
'app dir - metadata dynamic routes text routes should handle sitemap.[ext] dynamic routes',
79-
'app dir - metadata dynamic routes social image routes should handle manifest.[ext] dynamic routes',
80-
'app dir - metadata dynamic routes social image routes should render og image with opengraph-image dynamic routes',
81-
'app dir - metadata dynamic routes social image routes should render og image with twitter-image dynamic routes',
82-
'app dir - metadata dynamic routes icon image routes should render icon with dynamic routes',
83-
'app dir - metadata dynamic routes icon image routes should render apple icon with dynamic routes',
84-
'app dir - metadata dynamic routes should inject dynamic metadata properly to head',
85-
'app dir - metadata dynamic routes should use localhost for local prod and fallback to deployment url when metadataBase is falsy',
86-
],
87-
},
88-
'test/e2e/app-dir/metadata/metadata.test.ts': {
89-
flakey: [
90-
'app dir - metadata opengraph should pick up opengraph-image and twitter-image as static metadata files',
91-
'app dir - metadata static routes should have /favicon.ico as route',
92-
'app dir - metadata static routes should have icons as route',
93-
],
94-
},
95-
'test/e2e/basepath.test.ts': {
96-
flakey: [
97-
'basePath should not update URL for a 404',
98-
'basePath should handle 404 urls that start with basePath',
99-
'basePath should show 404 for page not under the /docs prefix',
100-
],
101-
},
102-
'test/e2e/app-dir/app/index.test.ts': {
103-
flakey: [
104-
'app dir - basic should return the `vary` header from edge runtime',
105-
'app dir - basic should return the `vary` header from pages for flight requests',
106-
],
107-
},
108-
'test/e2e/app-dir/conflicting-page-segments/conflicting-page-segments.test.ts': {
109-
flakey: [
110-
'conflicting-page-segments should throw an error when a route groups causes a conflict with a parallel segment',
111-
],
112-
},
113-
'test/e2e/app-dir/actions-navigation/index.test.ts': {
114-
flakey: [
115-
'app-dir action handling should handle actions correctly after following a relative link',
116-
],
117-
},
118-
'test/e2e/middleware-general/test/index.test.ts': {
119-
flakey: [
120-
'Middleware Runtime with i18n should redirect the same for direct visit and client-transition',
121-
'Middleware Runtime without i18n should redirect the same for direct visit and client-transition',
122-
// These rely on Cloudflare-specific error wording
123-
'Middleware Runtime with i18n should allow to abort a fetch request',
124-
'Middleware Runtime without i18n should allow to abort a fetch request',
125-
],
126-
},
127-
'test/e2e/prerender.test.ts': {
128-
flakey: [
129-
'Prerender should handle on-demand revalidate for fallback: blocking',
130-
// Header whitespace mismatch
131-
'Prerender should use correct caching headers for a revalidate page',
132-
// Header whitespace mismatch
133-
'Prerender should use correct caching headers for a no-revalidate page',
134-
],
135-
},
136-
'test/e2e/app-dir/app-routes/app-custom-route-base-path.test.ts': {
137-
flakey: [
138-
// Uses cli output
139-
'app-custom-routes no response returned should print an error when no response is returned',
140-
'app-custom-routes error conditions responds with 400 (Bad Request) when the requested method is not a valid HTTP method',
141-
],
142-
},
143-
'test/e2e/app-dir/app-routes/app-custom-routes.test.ts': {
144-
flakey: [
145-
// Uses cli output
146-
'app-custom-routes no response returned should print an error when no response is returned',
147-
'app-custom-routes error conditions responds with 400 (Bad Request) when the requested method is not a valid HTTP method',
148-
],
149-
},
150-
'test/e2e/app-dir/actions/app-action.test.ts': {
151-
flakey: [
152-
// Uses cli output
153-
'app-dir action handling should log a warning when a server action is not found but an id is provided',
154-
'app-dir action handling should work with interception routes',
155-
],
156-
},
157-
},
4+
suites: {},
1585
rules: {
1596
include: ['test/e2e/**/*.test.{t,j}s{,x}'],
160-
exclude: [
161-
// This is a template, not a real test file
162-
'test/e2e/test-template/{{ toFileName name }}/{{ toFileName name }}.test.ts',
163-
'test/e2e/app-dir/next-font/**/*',
164-
// We don't support PPR
165-
'test/e2e/app-dir/ppr/**/*',
166-
'test/e2e/app-dir/ppr-*/**/*',
167-
'test/e2e/app-dir/app-prefetch*/**/*',
168-
'test/e2e/app-dir/app-esm-js/index.test.ts',
169-
'test/e2e/app-dir/interception-middleware-rewrite/interception-middleware-rewrite.test.ts',
170-
'test/e2e/app-dir/searchparams-static-bailout/searchparams-static-bailout.test.ts',
171-
'test/e2e/app-dir/app-compilation/index.test.ts',
172-
'test/e2e/cancel-request/stream-cancel.test.ts',
173-
'test/e2e/favicon-short-circuit/favicon-short-circuit.test.ts',
174-
'test/e2e/edge-pages-support/edge-document.test.ts',
175-
'test/e2e/third-parties/index.test.ts',
176-
// Uses cli output
177-
'test/e2e/swc-warnings/index.test.ts',
178-
'test/e2e/app-dir/externals/externals.test.ts',
179-
'test/e2e/app-dir/use-selected-layout-segment-s/use-selected-layout-segment-s.test.ts',
180-
'test/e2e/repeated-forward-slashes-error/repeated-forward-slashes-error.test.ts',
181-
'test/e2e/app-dir/with-exported-function-config/with-exported-function-config.test.ts',
182-
'test/e2e/app-dir/x-forwarded-headers/x-forwarded-headers.test.ts',
183-
'test/e2e/app-dir/third-parties/basic.test.ts',
184-
'test/e2e/app-dir/conflicting-page-segments/conflicting-page-segments.test.ts',
185-
'test/e2e/404-page-router/index.test.ts',
186-
'test/e2e/app-dir/app-client-cache/client-cache.test.ts',
187-
'test/e2e/app-dir/app-fetch-deduping/app-fetch-deduping.test.ts',
188-
'test/e2e/app-dir/app/experimental-compile.test.ts',
189-
'test/e2e/app-dir/app/standalone-gsp.test.ts',
190-
'test/e2e/app-dir/app/standalone.test.ts',
191-
'test/e2e/app-dir/app/vercel-speed-insights.test.ts',
192-
'test/e2e/app-dir/build-size/index.test.ts',
193-
'test/e2e/app-dir/create-root-layout/create-root-layout.test.ts',
194-
'test/e2e/app-dir/headers-static-bailout/headers-static-bailout.test.ts',
195-
'test/e2e/app-dir/rewrites-redirects/rewrites-redirects.test.ts',
196-
'test/e2e/edge-compiler-can-import-blob-assets/index.test.ts',
197-
'test/e2e/i18n-data-fetching-redirect/index.test.ts',
198-
'test/e2e/manual-client-base-path/index.test.ts',
199-
'test/e2e/no-eslint-warn-with-no-eslint-config/index.test.ts',
200-
'test/e2e/switchable-runtime/index.test.ts',
201-
'test/e2e/trailingslash-with-rewrite/index.test.ts',
202-
'test/e2e/transpile-packages/index.test.ts',
203-
'test/e2e/typescript-version-no-warning/typescript-version-no-warning.test.ts',
204-
'test/e2e/typescript-version-warning/typescript-version-warning.test.ts',
205-
'test/e2e/app-dir/app/useReportWebVitals.test.ts',
206-
'test/e2e/app-dir/app-static/app-static-custom-handler.test.ts',
207-
// Tries to patch deployed files
208-
'test/e2e/app-dir/missing-suspense-with-csr-bailout/missing-suspense-with-csr-bailout.test.ts',
209-
// Tries to patch deployed files
210-
'test/e2e/module-layer/module-layer.test.ts',
211-
// Hard-coded localhost URL
212-
'test/e2e/app-dir/next-image/next-image-proxy.test.ts',
213-
'test/e2e/proxy-request-with-middleware/test/index.test.ts',
214-
// Uses invalid WASM syntax
215-
'test/e2e/edge-can-use-wasm-files/index.test.ts',
216-
// Expected behaviour does not match next start
217-
'test/e2e/i18n-data-route/i18n-data-route.test.ts',
218-
],
7+
/** @type {string[]} */
8+
exclude: [],
2199
},
22010
}
11+
12+
const rules = require('./test-config.json')
13+
14+
// Skip non-deploy tests
15+
config.rules.exclude.push(...rules.ignored)
16+
17+
for (const rule of rules.skipped) {
18+
// Individually-skipped tests
19+
if (rule.tests?.length) {
20+
config.suites[rule.file] = {
21+
failed: rule.tests,
22+
}
23+
} else {
24+
// Entire suite skipped
25+
config.rules.exclude.push(rule.file)
26+
}
27+
}
28+
29+
module.exports = config

0 commit comments

Comments
 (0)