Skip to content

Commit 948fd2b

Browse files
committed
test: don't prepare e2e-only fixtures ahead of time
1 parent e68d575 commit 948fd2b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/integration/turborepo.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ beforeEach<FixtureTestContext>(async (ctx) => {
2525
// monorepo test uses process.chdir which is not working inside vite workers
2626
// so I'm disabling that test for now will revisit later in a follow up PR.
2727
// we have at least a e2e test that tests the monorepo functionality
28+
// NOTE: turborepo-npm fixture is currently skipped in tests/prepare.mjs
29+
// be sure to unskip it there if you would be working on making this integration test work
2830
test.skip<FixtureTestContext>('should create the files in the correct directories', async (ctx) => {
2931
await createFixture('turborepo-npm', ctx)
3032
await runPlugin(ctx, { PACKAGE_PATH: 'apps/web' })

tests/prepare.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,31 @@ const NEXT_VERSION = process.env.NEXT_VERSION ?? 'latest'
1818
const fixturesDir = fileURLToPath(new URL(`./fixtures`, import.meta.url))
1919
const fixtureFilter = argv[2] ?? ''
2020

21+
// E2E tests run next builds, so we don't need to prepare those ahead of time for integration tests
22+
const e2eOnlyFixtures = new Set([
23+
'after',
24+
'cli-before-regional-blobs-support',
25+
'dist-dir',
26+
// There is also a bug on Windows on Node.js 18.20.6, that cause build failures on this fixture
27+
// see https://github.com/opennextjs/opennextjs-netlify/actions/runs/13268839161/job/37043172448?pr=2749#step:12:78
28+
'middleware-og',
29+
'middleware-single-matcher',
30+
'nx-integrated',
31+
'turborepo',
32+
// We do have a skipped test using this fixture (due to integration test setup not working for monorepos)
33+
'turborepo-npm',
34+
'unstable-cache',
35+
])
36+
2137
const limit = pLimit(Math.max(2, cpus().length / 2))
2238
const fixtures = readdirSync(fixturesDir)
2339
// Ignoring things like `.DS_Store`.
2440
.filter((fixture) => !fixture.startsWith('.'))
2541
// Applying the filter, if one is set.
2642
.filter((fixture) => !fixtureFilter || fixture.startsWith(fixtureFilter))
43+
// Filter out fixtures that are only needed for E2E tests
44+
.filter((fixture) => !e2eOnlyFixtures.has(fixture))
45+
2746
console.log(`🧪 Preparing fixtures: ${fixtures.join(', ')}`)
2847
const fixtureList = new Set(fixtures)
2948
const fixtureCount = fixtures.length

0 commit comments

Comments
 (0)