Skip to content

Commit

Permalink
Skip production tests for Turbopack
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 26, 2023
1 parent 7102e29 commit f0d5d8a
Show file tree
Hide file tree
Showing 92 changed files with 355 additions and 394 deletions.
2 changes: 1 addition & 1 deletion test/integration/404-page-app/test/index.test.js
Expand Up @@ -21,7 +21,7 @@ let appPort
let app

describe('404 Page Support with _app', () => {
describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
afterAll(() => killApp(app))

it('should build successfully', async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/amphtml/test/index.test.js
Expand Up @@ -25,7 +25,7 @@ let app
const context = {}

describe('AMP Usage', () => {
describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let output = ''

beforeAll(async () => {
Expand Down
3 changes: 1 addition & 2 deletions test/integration/app-tree/test/index.test.js
Expand Up @@ -56,8 +56,7 @@ describe('AppTree', () => {
afterAll(() => killApp(app))
runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
2 changes: 1 addition & 1 deletion test/integration/app-types/app-types.test.js
Expand Up @@ -7,7 +7,7 @@ import { nextBuild } from 'next-test-utils'
const appDir = __dirname

describe('app type checking', () => {
describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let stderr, errors
beforeAll(async () => {
stderr = (await nextBuild(appDir, [], { stderr: true })).stderr
Expand Down
3 changes: 1 addition & 2 deletions test/integration/async-modules/test/index.test.js
Expand Up @@ -115,8 +115,7 @@ describe('Async modules', () => {

runTests(true)
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
3 changes: 1 addition & 2 deletions test/integration/basepath-root-catch-all/test/index.test.js
Expand Up @@ -37,8 +37,7 @@ describe('dev mode', () => {
afterAll(() => killApp(app))
runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8')
Expand Down
3 changes: 1 addition & 2 deletions test/integration/client-404/test/index.test.js
Expand Up @@ -35,8 +35,7 @@ describe('Client 404', () => {

runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
context.appPort = await findPort()
Expand Down
3 changes: 1 addition & 2 deletions test/integration/client-shallow-routing/test/index.test.js
Expand Up @@ -97,8 +97,7 @@ describe('Client Shallow Routing', () => {

runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
6 changes: 2 additions & 4 deletions test/integration/css/test/css-modules.test.js
Expand Up @@ -93,8 +93,7 @@ describe('Basic CSS Modules Ordering', () => {

tests()
})

describe('Production Mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
Expand Down Expand Up @@ -436,8 +435,7 @@ describe('CSS Modules Composes Ordering', () => {

tests(true)
})

describe('Production Mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
Expand Down
180 changes: 96 additions & 84 deletions test/integration/css/test/css-rendering.test.js
Expand Up @@ -168,21 +168,24 @@ describe('CSS Support', () => {
})
}

describe('Production Mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
})

tests()
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
})

tests()
}
)
})

describe('CSS Cleanup on Render Failure', () => {
Expand Down Expand Up @@ -231,21 +234,24 @@ describe('CSS Support', () => {
})
}

describe('Production Mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
})

tests()
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)
})
afterAll(async () => {
await killApp(app)
})

tests()
}
)
})

describe('Page reload on CSS missing', () => {
Expand Down Expand Up @@ -280,31 +286,34 @@ describe('CSS Support', () => {
})
}

describe('Production Mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)

// Remove other page CSS files:
const manifest = await readJSON(
join(appDir, '.next', 'build-manifest.json')
)
const files = manifest['pages']['/other'].filter((e) =>
e.endsWith('.css')
)
if (files.length < 1) throw new Error()
await Promise.all(files.map((f) => remove(join(appDir, '.next', f))))
})
afterAll(async () => {
await killApp(app)
})

tests()
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)

// Remove other page CSS files:
const manifest = await readJSON(
join(appDir, '.next', 'build-manifest.json')
)
const files = manifest['pages']['/other'].filter((e) =>
e.endsWith('.css')
)
if (files.length < 1) throw new Error()
await Promise.all(files.map((f) => remove(join(appDir, '.next', f))))
})
afterAll(async () => {
await killApp(app)
})

tests()
}
)
})

describe('Page hydrates with CSS and not waiting on dependencies', () => {
Expand Down Expand Up @@ -373,34 +382,37 @@ describe('CSS Support', () => {
})
}

describe('Production Mode', () => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)

const buildId = (
await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8')
).trim()
const fileName = join(
appDir,
'.next/static/',
buildId,
'_buildManifest.js'
)
if (!(await pathExists(fileName))) {
throw new Error('Missing build manifest')
}
await remove(fileName)
})
afterAll(async () => {
await killApp(app)
})

tests()
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
beforeAll(async () => {
await remove(join(appDir, '.next'))
})
beforeAll(async () => {
await nextBuild(appDir, [], {})
appPort = await findPort()
app = await nextStart(appDir, appPort)

const buildId = (
await readFile(join(appDir, '.next', 'BUILD_ID'), 'utf8')
).trim()
const fileName = join(
appDir,
'.next/static/',
buildId,
'_buildManifest.js'
)
if (!(await pathExists(fileName))) {
throw new Error('Missing build manifest')
}
await remove(fileName)
})
afterAll(async () => {
await killApp(app)
})

tests()
}
)
})
})
3 changes: 1 addition & 2 deletions test/integration/custom-error/test/index.test.js
Expand Up @@ -79,8 +79,7 @@ describe('Custom _error', () => {
expect(html).toContain('An error 404 occurred on server')
})
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
let buildOutput = ''

beforeAll(async () => {
Expand Down
3 changes: 1 addition & 2 deletions test/integration/custom-page-extension/test/index.test.js
Expand Up @@ -35,8 +35,7 @@ describe('Custom page extension', () => {
afterAll(() => killApp(app))
runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
3 changes: 1 addition & 2 deletions test/integration/custom-routes-catchall/test/index.test.js
Expand Up @@ -53,8 +53,7 @@ describe('Custom routes', () => {
afterAll(() => killApp(app))
runTests(true)
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
Expand Up @@ -69,8 +69,7 @@ describe('Custom routes i18n with index redirect', () => {
afterAll(() => killApp(app))
runTests(true)
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
3 changes: 1 addition & 2 deletions test/integration/custom-routes-i18n/test/index.test.js
Expand Up @@ -176,8 +176,7 @@ describe('Custom routes i18n', () => {
afterAll(() => killApp(app))
runTests(true)
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await nextBuild(appDir)
appPort = await findPort()
Expand Down
10 changes: 6 additions & 4 deletions test/integration/custom-routes/test/index.test.js
Expand Up @@ -2970,9 +2970,11 @@ describe('Custom routes', () => {
describe('dev mode', () => {
runSoloTests(true)
})

describe('production mode', () => {
runSoloTests()
})
;(process.env.TURBOPACK ? describe.skip : describe)(
'production mode',
() => {
runSoloTests()
}
)
})
})
2 changes: 1 addition & 1 deletion test/integration/disable-js/test/index.test.js
Expand Up @@ -18,7 +18,7 @@ let app
const context = {}

describe('disabled runtime JS', () => {
describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
appPort = await findPort()

Expand Down
Expand Up @@ -10,7 +10,7 @@ let appPort
let app

describe('File Dependencies', () => {
describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
appPort = await findPort()
await nextBuild(appDir)
Expand Down
Expand Up @@ -62,8 +62,7 @@ describe('Dynamic Optional Routing Root Fallback', () => {

runTests()
})

describe('production mode', () => {
;(process.env.TURBOPACK ? describe.skip : describe)('production mode', () => {
beforeAll(async () => {
await fs.remove(join(appDir, '.next'))

Expand Down

0 comments on commit f0d5d8a

Please sign in to comment.