[test] Add suite for .env in App router based on existing Pages Router tests#92158
[test] Add suite for .env in App router based on existing Pages Router tests#92158eps1lon wants to merge 2 commits into
.env in App router based on existing Pages Router tests#92158Conversation
Failing test suitesCommit: 6382ef610efba3c218dca76ea405158313327d57 | About building and testing Next.js
Expand output● app-dir env-config › should have process environment override .env ● app-dir env-config › should provide global env to next.config.js ● app-dir env-config › should inline global values during build ● app-dir env-config › should provide env for static server component ● app-dir env-config › should provide env correctly for dynamic server component ● app-dir env-config › should provide env correctly for route handlers ● app-dir env-config › should load env from .env ● app-dir env-config › should use a consistent value across static, dynamic, and cached environments
Expand output● app dir - with output export (next start) › should warn during next start with output standalone
Expand output● app-dir static/dynamic handling › should respond correctly for dynamic route with dynamicParams false in layout ● app-dir static/dynamic handling › should respond correctly for dynamic route with dynamicParams false in layout ● app-dir static/dynamic handling › should respond correctly for partially dynamic route with dynamicParams false in layout ● app-dir static/dynamic handling › should respond correctly for partially dynamic route with dynamicParams false in layout ● app-dir static/dynamic handling › should use auto no cache when no fetch config ● app-dir static/dynamic handling › should use auto no cache when no fetch config ● app-dir static/dynamic handling › should correctly handle "default" cache statuses ● app-dir static/dynamic handling › should correctly handle "default" cache statuses ● app-dir static/dynamic handling › should still cache even though the W3C trace context headers ● app-dir static/dynamic handling › should still cache even though the W3C trace context headers ● app-dir static/dynamic handling › should warn for too many cache tags ● app-dir static/dynamic handling › should warn for too many cache tags ● app-dir static/dynamic handling › should propagate unstable_cache tags correctly ● app-dir static/dynamic handling › should propagate unstable_cache tags correctly ● app-dir static/dynamic handling › should infer a fetchCache of force-no-store when force-dynamic is used ● app-dir static/dynamic handling › should infer a fetchCache of force-no-store when force-dynamic is used ● app-dir static/dynamic handling › should infer a fetch cache of "force-cache" when force-dynamic is used on a fetch with revalidate ● app-dir static/dynamic handling › should infer a fetch cache of "force-cache" when force-dynamic is used on a fetch with revalidate ● app-dir static/dynamic handling › force-dynamic should supercede a "default" cache value ● app-dir static/dynamic handling › force-dynamic should supercede a "default" cache value ● app-dir static/dynamic handling › fetchCache config should supercede dynamic config when force-dynamic is used ● app-dir static/dynamic handling › fetchCache config should supercede dynamic config when force-dynamic is used ● app-dir static/dynamic handling › fetch ● app-dir static/dynamic handling › fetch ● app-dir static/dynamic handling › should correctly include headers instance in cache key ● app-dir static/dynamic handling › should correctly include headers instance in cache key ● app-dir static/dynamic handling › should correctly de-dupe fetch without next cache /react-fetch-deduping-node ● app-dir static/dynamic handling › should correctly de-dupe fetch without next cache /react-fetch-deduping-node ● app-dir static/dynamic handling › should correctly de-dupe fetch without next cache /react-fetch-deduping-edge ● app-dir static/dynamic handling › should correctly de-dupe fetch without next cache /react-fetch-deduping-edge ● app-dir static/dynamic handling › unstable-cache should work in pages/unstable-cache-node ● app-dir static/dynamic handling › unstable-cache should work in pages/unstable-cache-node ● app-dir static/dynamic handling › unstable-cache should work in pages/unstable-cache-edge ● app-dir static/dynamic handling › unstable-cache should work in pages/unstable-cache-edge ● app-dir static/dynamic handling › unstable-cache should work in pages/api/unstable-cache-node ● app-dir static/dynamic handling › unstable-cache should work in pages/api/unstable-cache-node ● app-dir static/dynamic handling › unstable-cache should work in pages/api/unstable-cache-edge ● app-dir static/dynamic handling › unstable-cache should work in pages/api/unstable-cache-edge ● app-dir static/dynamic handling › should not have cache tags header for non-minimal mode ● app-dir static/dynamic handling › should not have cache tags header for non-minimal mode ● app-dir static/dynamic handling › should correctly skip caching POST fetch for POST handler ● app-dir static/dynamic handling › should correctly skip caching POST fetch for POST handler ● app-dir static/dynamic handling › should correctly handle fetchCache = "force-no-store" ● app-dir static/dynamic handling › should correctly handle fetchCache = "force-no-store" ● app-dir static/dynamic handling › should not cache non-ok statusCode ● app-dir static/dynamic handling › should not cache non-ok statusCode ● app-dir static/dynamic handling › should not encode dynamic parameters as search parameters in RSC data ● app-dir static/dynamic handling › should not encode dynamic parameters as search parameters in RSC data ● app-dir static/dynamic handling › should output HTML/RSC files for static paths ● app-dir static/dynamic handling › should output HTML/RSC files for static paths ● app-dir static/dynamic handling › should have correct prerender-manifest entries ● app-dir static/dynamic handling › should have correct prerender-manifest entries ● app-dir static/dynamic handling › should output debug info for static bailouts ● app-dir static/dynamic handling › should output debug info for static bailouts ● app-dir static/dynamic handling › should log fetch metrics to the diagnostics directory ● app-dir static/dynamic handling › should log fetch metrics to the diagnostics directory ● app-dir static/dynamic handling › should have correct cache tags for prerendered path ● app-dir static/dynamic handling › should have correct cache tags for prerendered path ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving/app-page ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving/app-page ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving/route-handler ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving/route-handler ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving-edge/app-page ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving-edge/app-page ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving-edge/route-handler ● app-dir static/dynamic handling › should stream properly for /stale-cache-serving-edge/route-handler ● app-dir static/dynamic handling › should correctly handle statusCode with notFound + ISR ● app-dir static/dynamic handling › should correctly handle statusCode with notFound + ISR ● app-dir static/dynamic handling › should cache correctly for fetchCache = default-cache ● app-dir static/dynamic handling › should cache correctly for fetchCache = default-cache ● app-dir static/dynamic handling › should cache correctly when accessing search params opts into dynamic rendering ● app-dir static/dynamic handling › should cache correctly when accessing search params opts into dynamic rendering ● app-dir static/dynamic handling › should cache correctly for fetchCache = force-cache ● app-dir static/dynamic handling › should cache correctly for fetchCache = force-cache ● app-dir static/dynamic handling › should cache correctly for cache: "force-cache" and "revalidate" ● app-dir static/dynamic handling › should cache correctly for cache: "force-cache" and "revalidate" ● app-dir static/dynamic handling › should cache correctly for cache: no-store ● app-dir static/dynamic handling › should cache correctly for cache: no-store ● app-dir static/dynamic handling › should not error with dynamic server usage with force-static ● app-dir static/dynamic handling › should not error with dynamic server usage with force-static ● app-dir static/dynamic handling › should produce response with url from fetch ● app-dir static/dynamic handling › should produce response with url from fetch ● app-dir static/dynamic handling › should properly error when dynamic = "error" page uses dynamic ● app-dir static/dynamic handling › should properly error when dynamic = "error" page uses dynamic ● app-dir static/dynamic handling › should skip cache in draft mode ● app-dir static/dynamic handling › should skip cache in draft mode ● app-dir static/dynamic handling › should handle partial-gen-params with default dynamicParams correctly ● app-dir static/dynamic handling › should handle partial-gen-params with default dynamicParams correctly ● app-dir static/dynamic handling › should handle partial-gen-params with layout dynamicParams = false correctly ● app-dir static/dynamic handling › should handle partial-gen-params with layout dynamicParams = false correctly ● app-dir static/dynamic handling › should handle partial-gen-params with page dynamicParams = false correctly ● app-dir static/dynamic handling › should handle partial-gen-params with page dynamicParams = false correctly ● app-dir static/dynamic handling › should honor fetch cache correctly ● app-dir static/dynamic handling › should honor fetch cache correctly ● app-dir static/dynamic handling › should honor fetch cache correctly (edge) ● app-dir static/dynamic handling › should honor fetch cache correctly (edge) ● app-dir static/dynamic handling › should cache correctly with authorization header and revalidate ● app-dir static/dynamic handling › should cache correctly with authorization header and revalidate ● app-dir static/dynamic handling › should skip fetch cache when an authorization header is present after dynamic usage ● app-dir static/dynamic handling › should skip fetch cache when an authorization header is present after dynamic usage ● app-dir static/dynamic handling › should skip fetch cache when accessing request properties ● app-dir static/dynamic handling › should skip fetch cache when accessing request properties ● app-dir static/dynamic handling › should not cache correctly with POST method request init ● app-dir static/dynamic handling › should not cache correctly with POST method request init ● app-dir static/dynamic handling › should cache correctly with post method and revalidate ● app-dir static/dynamic handling › should cache correctly with post method and revalidate ● app-dir static/dynamic handling › should cache correctly with post method and revalidate edge ● app-dir static/dynamic handling › should cache correctly with post method and revalidate edge ● app-dir static/dynamic handling › should cache correctly with POST method and revalidate ● app-dir static/dynamic handling › should cache correctly with POST method and revalidate ● app-dir static/dynamic handling › should cache correctly with cookie header and revalidate ● app-dir static/dynamic handling › should cache correctly with cookie header and revalidate ● app-dir static/dynamic handling › should cache correctly with utf8 encoding ● app-dir static/dynamic handling › should cache correctly with utf8 encoding ● app-dir static/dynamic handling › should cache correctly with utf8 encoding edge ● app-dir static/dynamic handling › should cache correctly with utf8 encoding edge ● app-dir static/dynamic handling › should cache correctly handle JSON body ● app-dir static/dynamic handling › should cache correctly handle JSON body ● app-dir static/dynamic handling › should not throw Dynamic Server Usage error when using generateStaticParams with draftMode ● app-dir static/dynamic handling › should not throw Dynamic Server Usage error when using generateStaticParams with draftMode ● app-dir static/dynamic handling › should force SSR correctly for headers usage ● app-dir static/dynamic handling › should force SSR correctly for headers usage ● app-dir static/dynamic handling › should allow dynamic routes to access cookies ● app-dir static/dynamic handling › should allow dynamic routes to access cookies ● app-dir static/dynamic handling › should not error with generateStaticParams and dynamic data ● app-dir static/dynamic handling › should not error with generateStaticParams and dynamic data ● app-dir static/dynamic handling › should not error with force-dynamic and catch-all routes ● app-dir static/dynamic handling › should not error with force-dynamic and catch-all routes ● app-dir static/dynamic handling › should not error with generateStaticParams and authed data on revalidate ● app-dir static/dynamic handling › should not error with generateStaticParams and authed data on revalidate ● app-dir static/dynamic handling › should work with forced dynamic path ● app-dir static/dynamic handling › should work with forced dynamic path ● app-dir static/dynamic handling › should work with dynamic path no generateStaticParams ● app-dir static/dynamic handling › should work with dynamic path no generateStaticParams ● app-dir static/dynamic handling › should handle dynamicParams: true correctly ● app-dir static/dynamic handling › should handle dynamicParams: true correctly ● app-dir static/dynamic handling › should ssr dynamically when detected automatically with fetch cache option ● app-dir static/dynamic handling › should ssr dynamically when detected automatically with fetch cache option ● app-dir static/dynamic handling › should render not found pages correctly and fallback to the default one ● app-dir static/dynamic handling › should render not found pages correctly and fallback to the default one ● app-dir static/dynamic handling › should ssr dynamically when detected automatically with fetch revalidate option ● app-dir static/dynamic handling › should ssr dynamically when detected automatically with fetch revalidate option ● app-dir static/dynamic handling › should ssr dynamically when forced via config ● app-dir static/dynamic handling › should ssr dynamically when forced via config ● app-dir static/dynamic handling › useSearchParams › client › should bailout to client rendering - with suspense boundary ● app-dir static/dynamic handling › useSearchParams › client › should bailout to client rendering - with suspense boundary ● app-dir static/dynamic handling › useSearchParams › client › should have empty search params on force-static ● app-dir static/dynamic handling › useSearchParams › client › should have empty search params on force-static ● app-dir static/dynamic handling › useSearchParams › client › should have values from canonical url on rewrite ● app-dir static/dynamic handling › useSearchParams › client › should have values from canonical url on rewrite ● app-dir static/dynamic handling › useSearchParams › server response › should bailout to client rendering - with suspense boundary ● app-dir static/dynamic handling › useSearchParams › server response › should bailout to client rendering - with suspense boundary ● app-dir static/dynamic handling › useSearchParams › server response › should have empty search params on force-static ● app-dir static/dynamic handling › useSearchParams › server response › should have empty search params on force-static ● app-dir static/dynamic handling › usePathname › should have the correct values ● app-dir static/dynamic handling › usePathname › should have the correct values ● app-dir static/dynamic handling › usePathname › should have values from canonical url on rewrite ● app-dir static/dynamic handling › usePathname › should have values from canonical url on rewrite ● app-dir static/dynamic handling › unstable_noStore › should opt-out of static optimization ● app-dir static/dynamic handling › unstable_noStore › should opt-out of static optimization ● app-dir static/dynamic handling › unstable_noStore › should not opt-out of static optimization when used in next/cache ● app-dir static/dynamic handling › unstable_noStore › should not opt-out of static optimization when used in next/cache ● app-dir static/dynamic handling › unstable_cache › should retrieve the same value on second request ● app-dir static/dynamic handling › unstable_cache › should retrieve the same value on second request ● app-dir static/dynamic handling › unstable_cache › should bypass cache in draft mode ● app-dir static/dynamic handling › unstable_cache › should bypass cache in draft mode ● app-dir static/dynamic handling › unstable_cache › should not cache new result in draft mode ● app-dir static/dynamic handling › unstable_cache › should not cache new result in draft mode ● app-dir static/dynamic handling › unstable_cache › should be able to read the draft mode status ● app-dir static/dynamic handling › unstable_cache › should be able to read the draft mode status ● app-dir static/dynamic handling › unstable_cache › should not error when retrieving the value undefined ● app-dir static/dynamic handling › unstable_cache › should not error when retrieving the value undefined ● app-dir static/dynamic handling › unstable_cache › should not error when calling a fetch no-store ● app-dir static/dynamic handling › unstable_cache › should not error when calling a fetch no-store ● app-dir static/dynamic handling › unstable_cache › should not error when calling a fetch no-cache ● app-dir static/dynamic handling › unstable_cache › should not error when calling a fetch no-cache ● app-dir static/dynamic handling › should keep querystring on static page ● app-dir static/dynamic handling › should keep querystring on static page ● app-dir static/dynamic handling › should have logs from cache-handler ● app-dir static/dynamic handling › should have logs from cache-handler ● app-dir static/dynamic handling › Incremental cache limits › should cache large data when using custom cache handler and force-cache mode ● app-dir static/dynamic handling › Incremental cache limits › should cache large data when using custom cache handler and force-cache mode ● app-dir static/dynamic handling › should build dynamic param with edge runtime correctly ● app-dir static/dynamic handling › should build dynamic param with edge runtime correctly ● app-dir static/dynamic handling › updateTag/revalidateTag › should throw error when updateTag is called in route handler ● app-dir static/dynamic handling › updateTag/revalidateTag › should throw error when updateTag is called in route handler ● app-dir static/dynamic handling › updateTag/revalidateTag › should successfully update tag when called from server action ● app-dir static/dynamic handling › updateTag/revalidateTag › should successfully update tag when called from server action ● app-dir static/dynamic handling › updateTag/revalidateTag › revalidateTag work with max profile in server actions ● app-dir static/dynamic handling › updateTag/revalidateTag › revalidateTag work with max profile in server actions ● app-dir static/dynamic handling › updateTag/revalidateTag › should show deprecation warning for revalidateTag without second argument ● app-dir static/dynamic handling › updateTag/revalidateTag › should show deprecation warning for revalidateTag without second argument ● Test suite failed to run
Expand output● instant validation - parallel slot configs › dev - client navigation › config on slot page › catches unsuspended dynamic content in children when config is on slot layout |
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
8b10036 to
972b9e4
Compare
6382ef6 to
bb97bc2
Compare
Failing test suitesCommit: a203169 | About building and testing Next.js
Expand output● instant-nav-panel › should show loading skeleton during SPA navigation after clicking Start
Expand output● interception-dynamic-single-segment › should intercept with consecutive dynamic segments
Expand output● allowed-dev-origins, basePath: "" › configured allowed origins › should block no-cors requests without a referer even when origins are configured ● allowed-dev-origins, basePath: "/docs" › configured allowed origins › should block no-cors requests without a referer even when origins are configured |
bb97bc2 to
a203169
Compare
Failing test suitesCommit: a203169 | About building and testing Next.js
Expand output● instant-nav-panel › should show loading skeleton during SPA navigation after clicking Start
Expand output● app-dir env-config › should provide env for static server component ● app-dir env-config › should provide env correctly for dynamic server component ● app-dir env-config › should provide env correctly for route handlers ● app-dir env-config › should load env from .env ● app-dir env-config › should use a consistent value across static, dynamic, and cached environments |
We got reports that this behavior changed in 16.2. Since we don't have any tests for App router, I'm adding some.
Hopefully the existing tests catch the regression. Otherwise I'll just copy the case from #92116