-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip production tests for Turbopack (#56089)
Follow-up to #56045. Found there was a group of tests for production called `server mode` instead of `production mode`, those are skipped too now. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
- Loading branch information
1 parent
3eadfe9
commit cbe8238
Showing
45 changed files
with
492 additions
and
484 deletions.
There are no files selected for viewing
113 changes: 60 additions & 53 deletions
113
test/e2e/instrumentation-hook-src/instrumentation-hook-src.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,65 @@ | ||
import { createNextDescribe } from 'e2e-utils' | ||
import { check } from 'next-test-utils' | ||
|
||
createNextDescribe( | ||
'instrumentation-hook-src', | ||
{ | ||
files: __dirname, | ||
nextConfig: { | ||
experimental: { | ||
instrumentationHook: true, | ||
;(process.env.TURBOPACK ? describe.skip : describe)( | ||
'instrumentation-hook-rsc', | ||
() => { | ||
createNextDescribe( | ||
'instrumentation', | ||
{ | ||
files: __dirname, | ||
nextConfig: { | ||
experimental: { | ||
instrumentationHook: true, | ||
}, | ||
}, | ||
skipDeployment: true, | ||
}, | ||
}, | ||
skipDeployment: true, | ||
}, | ||
({ next, isNextDev }) => { | ||
it('should run the instrumentation hook', async () => { | ||
await next.render('/') | ||
await check(() => next.cliOutput, /instrumentation hook/) | ||
}) | ||
it('should not overlap with a instrumentation page', async () => { | ||
const page = await next.render('/instrumentation') | ||
expect(page).toContain('Hello') | ||
}) | ||
it('should run the edge instrumentation compiled version with the edge runtime', async () => { | ||
await next.render('/edge') | ||
await check(() => next.cliOutput, /instrumentation hook on the edge/) | ||
}) | ||
if (isNextDev) { | ||
// TODO: Implement handling for changing the instrument file. | ||
it.skip('should reload the server when the instrumentation hook changes', async () => { | ||
await next.render('/') | ||
await next.patchFile( | ||
'./src/instrumentation.js', | ||
`export function register() {console.log('toast')}` | ||
) | ||
await check(() => next.cliOutput, /toast/) | ||
await next.renameFile( | ||
'./src/instrumentation.js', | ||
'./src/instrumentation.js.bak' | ||
) | ||
await check( | ||
() => next.cliOutput, | ||
/The instrumentation file has been removed/ | ||
) | ||
await next.patchFile( | ||
'./src/instrumentation.js.bak', | ||
`export function register() {console.log('bread')}` | ||
) | ||
await next.renameFile( | ||
'./src/instrumentation.js.bak', | ||
'./src/instrumentation.js' | ||
) | ||
await check(() => next.cliOutput, /The instrumentation file was added/) | ||
await check(() => next.cliOutput, /bread/) | ||
}) | ||
} | ||
({ next, isNextDev }) => { | ||
it('should run the instrumentation hook', async () => { | ||
await next.render('/') | ||
await check(() => next.cliOutput, /instrumentation hook/) | ||
}) | ||
it('should not overlap with a instrumentation page', async () => { | ||
const page = await next.render('/instrumentation') | ||
expect(page).toContain('Hello') | ||
}) | ||
it('should run the edge instrumentation compiled version with the edge runtime', async () => { | ||
await next.render('/edge') | ||
await check(() => next.cliOutput, /instrumentation hook on the edge/) | ||
}) | ||
if (isNextDev) { | ||
// TODO: Implement handling for changing the instrument file. | ||
it.skip('should reload the server when the instrumentation hook changes', async () => { | ||
await next.render('/') | ||
await next.patchFile( | ||
'./src/instrumentation.js', | ||
`export function register() {console.log('toast')}` | ||
) | ||
await check(() => next.cliOutput, /toast/) | ||
await next.renameFile( | ||
'./src/instrumentation.js', | ||
'./src/instrumentation.js.bak' | ||
) | ||
await check( | ||
() => next.cliOutput, | ||
/The instrumentation file has been removed/ | ||
) | ||
await next.patchFile( | ||
'./src/instrumentation.js.bak', | ||
`export function register() {console.log('bread')}` | ||
) | ||
await next.renameFile( | ||
'./src/instrumentation.js.bak', | ||
'./src/instrumentation.js' | ||
) | ||
await check( | ||
() => next.cliOutput, | ||
/The instrumentation file was added/ | ||
) | ||
await check(() => next.cliOutput, /bread/) | ||
}) | ||
} | ||
} | ||
) | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.