Unverified Commit 646ae98d authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Skip more production tests for turbopack (#56084)

Follow-up to #56045.

<!-- 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 #

-->
parent ef4faa5f
......@@ -1369,20 +1369,72 @@ export const setupTests = (ctx) => {
runTests(curCtx)
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'Production Mode Server support w/o next.config.js',
() => {
if (ctx.nextConfigImages) {
// skip this test because it requires next.config.js
return
}
const size = 384 // defaults defined in server/config.ts
const curCtx = {
...ctx,
w: size,
isDev: false,
}
beforeAll(async () => {
curCtx.nextOutput = ''
await nextBuild(curCtx.appDir)
await cleanImagesDir(ctx)
curCtx.appPort = await findPort()
curCtx.app = await nextStart(curCtx.appDir, curCtx.appPort, {
onStderr(msg) {
curCtx.nextOutput += msg
},
env: {
NEXT_SHARP_PATH: curCtx.isSharp
? join(curCtx.appDir, 'node_modules', 'sharp')
: '',
},
cwd: curCtx.appDir,
})
})
afterAll(async () => {
if (curCtx.app) await killApp(curCtx.app)
})
describe('Server support w/o next.config.js', () => {
if (ctx.nextConfigImages) {
// skip this test because it requires next.config.js
return
runTests(curCtx)
}
const size = 384 // defaults defined in server/config.ts
)
}
;(process.env.TURBOPACK ? describe.skip : describe)(
'Production Mode Server support with next.config.js',
() => {
const size = 399
const curCtx = {
...ctx,
w: size,
isDev: false,
nextConfigImages: {
domains: [
'localhost',
'127.0.0.1',
'example.com',
'assets.vercel.com',
'image-optimization-test.vercel.app',
],
formats: ['image/avif', 'image/webp'],
deviceSizes: [size, largeSize],
...ctx.nextConfigImages,
},
}
beforeAll(async () => {
const json = JSON.stringify({
images: curCtx.nextConfigImages,
})
curCtx.nextOutput = ''
nextConfig.replace('{ /* replaceme */ }', json)
await nextBuild(curCtx.appDir)
await cleanImagesDir(ctx)
curCtx.appPort = await findPort()
......@@ -1399,58 +1451,11 @@ export const setupTests = (ctx) => {
})
})
afterAll(async () => {
nextConfig.restore()
if (curCtx.app) await killApp(curCtx.app)
})
runTests(curCtx)
})
}
describe('Server support with next.config.js', () => {
const size = 399
const curCtx = {
...ctx,
w: size,
isDev: false,
nextConfigImages: {
domains: [
'localhost',
'127.0.0.1',
'example.com',
'assets.vercel.com',
'image-optimization-test.vercel.app',
],
formats: ['image/avif', 'image/webp'],
deviceSizes: [size, largeSize],
...ctx.nextConfigImages,
},
}
beforeAll(async () => {
const json = JSON.stringify({
images: curCtx.nextConfigImages,
})
curCtx.nextOutput = ''
nextConfig.replace('{ /* replaceme */ }', json)
await nextBuild(curCtx.appDir)
await cleanImagesDir(ctx)
curCtx.appPort = await findPort()
curCtx.app = await nextStart(curCtx.appDir, curCtx.appPort, {
onStderr(msg) {
curCtx.nextOutput += msg
},
env: {
NEXT_SHARP_PATH: curCtx.isSharp
? join(curCtx.appDir, 'node_modules', 'sharp')
: '',
},
cwd: curCtx.appDir,
})
})
afterAll(async () => {
nextConfig.restore()
if (curCtx.app) await killApp(curCtx.app)
})
runTests(curCtx)
})
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment