Skip to content

Commit c9c6285

Browse files
authored
[ci]: split clientSegmentCache test runners off from experimental (#84440)
We are preparing to enable `clientSegmentCache` by default on canary. To prepare, this splits it into a separate CI runner and adds a failing test manifest so we can incrementally migrate / fix failing tests before stable release.
1 parent c4e1f61 commit c9c6285

File tree

5 files changed

+231
-0
lines changed

5 files changed

+231
-0
lines changed

.github/workflows/build_and_test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,73 @@ jobs:
992992
stepName: 'test-experimental-prod-${{ matrix.group }}'
993993
secrets: inherit
994994

995+
test-client-segment-cache-integration:
996+
name: test clientSegmentCache integration
997+
needs: ['optimize-ci', 'changes', 'build-native', 'build-next']
998+
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
999+
1000+
uses: ./.github/workflows/build_reusable.yml
1001+
with:
1002+
nodeVersion: 20.9.0
1003+
afterBuild: |
1004+
export __NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE=true
1005+
export NEXT_EXTERNAL_TESTS_FILTERS="test/client-segment-cache-tests-manifest.json"
1006+
export IS_WEBPACK_TEST=1
1007+
1008+
node run-tests.js \
1009+
--timings \
1010+
--type integration
1011+
stepName: 'test-client-segment-cache-integration'
1012+
secrets: inherit
1013+
1014+
test-client-segment-cache-dev:
1015+
name: test clientSegmentCache dev
1016+
needs: ['optimize-ci', 'changes', 'build-native', 'build-next']
1017+
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
1018+
1019+
strategy:
1020+
fail-fast: false
1021+
matrix:
1022+
group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
1023+
uses: ./.github/workflows/build_reusable.yml
1024+
with:
1025+
afterBuild: |
1026+
export __NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE=true
1027+
export NEXT_EXTERNAL_TESTS_FILTERS="test/client-segment-cache-tests-manifest.json"
1028+
export NEXT_TEST_MODE=dev
1029+
export IS_WEBPACK_TEST=1
1030+
1031+
node run-tests.js \
1032+
--timings \
1033+
-g ${{ matrix.group }} \
1034+
--type development
1035+
stepName: 'test-client-segment-cache-dev-${{ matrix.group }}'
1036+
secrets: inherit
1037+
1038+
test-client-segment-cache-prod:
1039+
name: test clientSegmentCache prod
1040+
needs: ['optimize-ci', 'changes', 'build-native', 'build-next']
1041+
if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }}
1042+
1043+
strategy:
1044+
fail-fast: false
1045+
matrix:
1046+
group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
1047+
uses: ./.github/workflows/build_reusable.yml
1048+
with:
1049+
afterBuild: |
1050+
export __NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE=true
1051+
export NEXT_EXTERNAL_TESTS_FILTERS="test/client-segment-cache-tests-manifest.json"
1052+
export NEXT_TEST_MODE=start
1053+
export IS_WEBPACK_TEST=1
1054+
1055+
node run-tests.js \
1056+
--timings \
1057+
-g ${{ matrix.group }} \
1058+
--type production
1059+
stepName: 'test-client-segment-cache-prod-${{ matrix.group }}'
1060+
secrets: inherit
1061+
9951062
tests-pass:
9961063
needs:
9971064
[
@@ -1010,6 +1077,9 @@ jobs:
10101077
'test-experimental-dev',
10111078
'test-experimental-prod',
10121079
'test-experimental-integration',
1080+
'test-client-segment-cache-dev',
1081+
'test-client-segment-cache-prod',
1082+
'test-client-segment-cache-integration',
10131083
'test-cargo-unit',
10141084
'rust-check',
10151085
'rustdoc-check',

packages/next/src/server/config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,25 @@ function enforceExperimentalFeatures(
17091709
}
17101710
}
17111711

1712+
// TODO: Remove this once we've made Client Segment Cache the default.
1713+
if (
1714+
process.env.__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE === 'true' &&
1715+
// We do respect an explicit value in the user config.
1716+
(config.experimental.clientSegmentCache === undefined ||
1717+
(isDefaultConfig && !config.experimental.clientSegmentCache))
1718+
) {
1719+
config.experimental.clientSegmentCache = true
1720+
1721+
if (configuredExperimentalFeatures) {
1722+
addConfiguredExperimentalFeature(
1723+
configuredExperimentalFeatures,
1724+
'clientSegmentCache',
1725+
true,
1726+
'enabled by `__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE`'
1727+
)
1728+
}
1729+
}
1730+
17121731
// TODO: Remove this once we've made Client Param Parsing the default.
17131732
if (
17141733
process.env.__NEXT_EXPERIMENTAL_PPR === 'true' &&
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"version": 2,
3+
"suites": {
4+
"test/e2e/app-dir/actions/app-action-node-middleware.test.ts": {
5+
"failed": [
6+
"app-dir action handling fetch actions should handle redirects to routes that provide an invalid RSC response",
7+
"app-dir action handling should reset the form state when the action redirects to itself"
8+
]
9+
},
10+
"test/e2e/app-dir/actions/app-action.test.ts": {
11+
"failed": [
12+
"app-dir action handling fetch actions should handle redirects to routes that provide an invalid RSC response",
13+
"app-dir action handling should reset the form state when the action redirects to itself"
14+
]
15+
},
16+
"test/e2e/app-dir/app-client-cache/client-cache.experimental.test.ts": {
17+
"failed": [
18+
"app dir client cache semantics (experimental staleTimes) static: 180 prefetch={true} should use the custom static override time (3 minutes)"
19+
]
20+
},
21+
"test/e2e/app-dir/app-prefetch/prefetching.stale-times.test.ts": {
22+
"failed": [
23+
"app dir - prefetching (custom staleTime) should fetch again when a static page was prefetched when navigating to it after the stale time has passed",
24+
"app dir - prefetching (custom staleTime) should fetch again when the initially visited static page is visited after the stale time has passed",
25+
"app dir - prefetching (custom staleTime) should not fetch again when a static page was prefetched when navigating to it twice",
26+
"app dir - prefetching (custom staleTime) should renew the stale time after refetching expired RSC data"
27+
]
28+
},
29+
"test/e2e/app-dir/app-prefetch/prefetching.test.ts": {
30+
"failed": [
31+
"app dir - prefetching fetch priority should have an auto priority for all other fetch operations",
32+
"app dir - prefetching fetch priority should prefetch with high priority when navigating to a page without a prefetch entry",
33+
"app dir - prefetching prefetch cache seeding should not re-fetch the initial dynamic page if the same page is prefetched with prefetch={true}",
34+
"app dir - prefetching prefetch cache seeding should not re-fetch the initial static page if the same page is prefetched with prefetch={true}",
35+
"app dir - prefetching should calculate `_rsc` query based on `Next-Url`",
36+
"app dir - prefetching should immediately render the loading state for a dynamic segment when fetched from higher up in the tree",
37+
"app dir - prefetching should not fetch again when a static page was prefetched",
38+
"app dir - prefetching should not unintentionally modify the requested prefetch by escaping the uri encoded query params"
39+
]
40+
},
41+
"test/e2e/app-dir/app-static/app-static-custom-handler.test.ts": {
42+
"failed": [
43+
"app-dir static/dynamic handling should output HTML/RSC files for static paths"
44+
]
45+
},
46+
"test/e2e/app-dir/app-static/app-static.test.ts": {
47+
"failed": [
48+
"app-dir static/dynamic handling should output HTML/RSC files for static paths"
49+
]
50+
},
51+
"test/e2e/app-dir/navigation/navigation.test.ts": {
52+
"failed": [
53+
"app dir - navigation middleware redirect should change browser location when router.refresh() gets a redirect response"
54+
]
55+
},
56+
"test/e2e/app-dir/parallel-routes-and-interception/parallel-routes-and-interception.test.ts": {
57+
"failed": [
58+
"parallel-routes-and-interception route intercepting should support intercepting local dynamic sibling routes"
59+
]
60+
},
61+
"test/e2e/app-dir/parallel-routes-revalidation/parallel-routes-revalidation.test.ts": {
62+
"failed": [
63+
"parallel-routes-revalidation router.refresh (dynamic) - searchParams: false should correctly refresh data for previously intercepted modal and active page slot",
64+
"parallel-routes-revalidation router.refresh (dynamic) - searchParams: true should correctly refresh data for previously intercepted modal and active page slot",
65+
"parallel-routes-revalidation router.refresh (dynamic) - searchParams: true should correctly refresh data for the intercepted route and previously active page slot",
66+
"parallel-routes-revalidation router.refresh (regular) - searchParams: false should correctly refresh data for previously intercepted modal and active page slot",
67+
"parallel-routes-revalidation router.refresh (regular) - searchParams: true should correctly refresh data for previously intercepted modal and active page slot",
68+
"parallel-routes-revalidation router.refresh (regular) - searchParams: true should correctly refresh data for the intercepted route and previously active page slot",
69+
"parallel-routes-revalidation server action revalidation handles refreshing when multiple parallel slots are active",
70+
"parallel-routes-revalidation server action revalidation should not trigger a refresh for the page that is being redirected to"
71+
]
72+
},
73+
"test/e2e/app-dir/ppr-navigations/loading-tsx-no-partial-rendering/loading-tsx-no-partial-rendering.test.ts": {
74+
"failed": [
75+
"loading-tsx-no-partial-rendering when PPR is enabled, loading.tsx boundaries do not cause a partial prefetch"
76+
]
77+
},
78+
"test/e2e/app-dir/searchparams-reuse-loading/searchparams-reuse-loading.test.ts": {
79+
"failed": [
80+
"searchparams-reuse-loading should re-use loading from \"full\" prefetch for param-full URL when navigating to param-full route",
81+
"searchparams-reuse-loading should re-use loading from \"full\" prefetch for param-full URL when navigating to param-less route",
82+
"searchparams-reuse-loading should re-use loading from \"full\" prefetch for param-less URL when navigating to param-full route"
83+
]
84+
},
85+
"test/e2e/next-form/default/next-form-prefetch.test.ts": {
86+
"failed": [
87+
"app dir - form prefetching should prefetch a loading state for the form's target"
88+
]
89+
},
90+
"test/integration/app-dir-export/test/config.test.ts": {
91+
"failed": [
92+
"app dir - with output export (next dev / next build) production mode should correctly emit exported assets to config.distDir"
93+
]
94+
},
95+
"test/integration/app-dir-export/test/dynamicapiroute-prod.test.ts": {
96+
"failed": [
97+
"app dir - with output export - dynamic api route prod production mode should work in prod with dynamicApiRoute 'error'",
98+
"app dir - with output export - dynamic api route prod production mode should work in prod with dynamicApiRoute 'force-static'"
99+
]
100+
},
101+
"test/integration/app-dir-export/test/dynamicpage-prod.test.ts": {
102+
"failed": [
103+
"app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage 'error'",
104+
"app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage 'force-static'",
105+
"app dir - with output export - dynamic api route prod production mode should work in prod with dynamicPage undefined"
106+
]
107+
},
108+
"test/integration/app-dir-export/test/trailing-slash-start.test.ts": {
109+
"failed": [
110+
"app dir - with output export - trailing slash prod production mode should work in prod with trailingSlash 'false'",
111+
"app dir - with output export - trailing slash prod production mode should work in prod with trailingSlash 'true'"
112+
]
113+
},
114+
"test/production/app-dir/build-output-prerender/build-output-prerender.test.ts": {
115+
"failed": [
116+
"build-output-prerender with a next config file with --debug-prerender prints a warning and the customized experimental flags",
117+
"build-output-prerender with a next config file without --debug-prerender prints only the user-selected experimental flags (and the ones enabled via env variable)",
118+
"build-output-prerender without a next config file with --debug-prerender prints a warning and the customized experimental flags",
119+
"build-output-prerender without a next config file without --debug-prerender prints no experimental flags (unless enabled via env variable)"
120+
]
121+
}
122+
},
123+
"rules": {
124+
"include": [
125+
"test/e2e/**/*.test.{t,j}s{,x}",
126+
"test/integration/app-*/**/*.test.{t,j}s{,x}",
127+
"test/production/app-*/**/*.test.{t,j}s{,x}",
128+
"test/development/app-*/**/*.test.{t,j}s{,x}",
129+
"test/development/acceptance-app/**/*.test.{t,j}s{,x}"
130+
],
131+
"exclude": []
132+
}
133+
}

test/lib/next-modes/base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ export class NextInstance {
409409
if (process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHE_COMPONENTS) {
410410
process.env.__NEXT_EXPERIMENTAL_CACHE_COMPONENTS = process.env.NEXT_PRIVATE_EXPERIMENTAL_CACHE_COMPONENTS
411411
}
412+
if (process.env.NEXT_PRIVATE_EXPERIMENTAL_CLIENT_SEGMENT_CACHE) {
413+
process.env.__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE = process.env.NEXT_PRIVATE_EXPERIMENTAL_CLIENT_SEGMENT_CACHE
414+
}
412415
`
413416
)
414417

test/lib/next-modes/next-deploy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ export class NextDeployInstance extends NextInstance {
111111
)
112112
}
113113

114+
if (process.env.__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE) {
115+
additionalEnv.push(
116+
`NEXT_PRIVATE_EXPERIMENTAL_CLIENT_SEGMENT_CACHE=${process.env.__NEXT_EXPERIMENTAL_CLIENT_SEGMENT_CACHE}`
117+
)
118+
}
119+
114120
if (process.env.IS_TURBOPACK_TEST) {
115121
additionalEnv.push(`IS_TURBOPACK_TEST=1`)
116122
}

0 commit comments

Comments
 (0)