next.js
f219487d - feat(test): introduce cache components testing infrastructure (#81394)

Commit
166 days ago
feat(test): introduce cache components testing infrastructure (#81394) ### What? Introduces a testing infrastructure to validate Next.js behavior with the experimental Cache Components feature (`dynamicIO`) enabled. This PR adds dedicated CI jobs and configuration to run a subset of existing tests with Cache Components activated. This has 271 more disabled test suites than the Legacy PPR test suite manifest. The expectation is that we will be resolving the test failures in followup PRs. ### Why? Cache Components (dynamicIO) represents a significant architectural change in how Next.js handles component caching and rendering. To ensure a smooth transition when this becomes the default behavior, we need to: 1. **Validate compatibility** - Ensure existing applications continue to work correctly when Cache Components is enabled 2. **Identify edge cases** - Catch potential issues early by running tests in this new mode 3. **Build confidence** - Provide a safety net for the eventual migration to Cache Components as the default The manifest-based approach allows us to incrementally expand test coverage as we fix compatibility issues, rather than attempting to run all tests at once which would be overwhelming and block progress. ### How? - **Test manifest** (`test/cache-components-tests-manifest.json`): Defines which tests to run and tracks known failures that need addressing - **CI workflow changes**: Adds three new job groups that mirror existing test jobs but with Cache Components enabled: - `test-cache-components-integration` - `test-cache-components-dev` (parallelized across 6 groups) - `test-cache-components-prod` (parallelized across 7 groups) - **Conditional feature activation**: When `__NEXT_EXPERIMENTAL_CACHE_COMPONENTS=true` is set during testing, `dynamicIO` is automatically enabled unless explicitly disabled - **Test adjustments**: Updates error message expectations in tests to handle the different environment label ("Prerender" vs "Server") when Cache Components is active The infrastructure is designed to be temporary and will be removed once Cache Components becomes the default behavior. NAR-172
Author
Parents
Loading