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

Skip production tests for Turbopack #56045

Merged
merged 2 commits into from Sep 26, 2023
Merged
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions .github/workflows/build_and_test.yml
Expand Up @@ -152,19 +152,19 @@ jobs:
secrets: inherit

# --type production also runs tests/e2e
test-turbopack-prod:
name: test turbopack prod
needs: ['build-native', 'build-next']
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5]
uses: ./.github/workflows/build_reusable.yml
with:
nodeVersion: 16
skipForDocsOnly: 'yes'
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
secrets: inherit
# test-turbopack-prod:
# name: test turbopack prod
# needs: ['build-native', 'build-next']
# strategy:
# fail-fast: false
# matrix:
# group: [1, 2, 3, 4, 5]
# uses: ./.github/workflows/build_reusable.yml
# with:
# nodeVersion: 16
# skipForDocsOnly: 'yes'
# afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.json" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
# secrets: inherit

test-next-swc-wasm:
name: test next-swc wasm
Expand Down
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
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
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
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