Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(next-dev): hard fail if next-dev runs with turbopack intenral flag #51308

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/next/src/cli/next-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ const nextDev: CliCommand = async (argv) => {
} else {
let cleanupFns: (() => Promise<void> | void)[] = []
const runDevServer = async () => {
if (process.env.__INTERNAL_NEXT_DEV_TEST_TURBO_DEV) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to fail higher up as it can be called via custom server and such directly bypassing the CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik --turbo and any other turbopack related path does not work / considers custom server case even. does current test cases (using launchapp) have a setup that doesn't uses cli and need to pass --turbo / and custom server both?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there are tests that bypass the CLI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those I'd like to approach with what Main mentioned - filter out tests that neither uses next-dev / turbopack and put it into permanent exclusion list for the turbopack tests.

require('console').error(
`[ERROR]: Incorrect mode: turbopack test mode is force enabled, shouldn't run dev server`
)
process.exit(1)
}
const oldCleanupFns = cleanupFns
cleanupFns = []
await Promise.allSettled(oldCleanupFns.map((fn) => fn()))
Expand Down