-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update yarn PnP tests and disable swc file reading for PnP (#33236)
* Update yarn PnP tests and disable swc file reading for PnP * update job * Update test * add env variable * update destory * test one * bump timeout * update pnp install command * only run pnp test * add more logs * handle exit signal * dont inherit stdio for install * update server start * re-add test type * add build log * additional logging * update build command * remove separate timeout * update install command * install separate for better time info * add cache pre-warming * update yarn config * enable other pnp tests * Separate out tests * fix-lint * update path * update test concurrency for isolated tests * update retries * Revert "update test concurrency for isolated tests" This reverts commit 3a6e924. * re-enable production tests * apply suggestions
- Loading branch information
Showing
16 changed files
with
231 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('progressive-web-app') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import fs from 'fs-extra' | ||
import { join } from 'path' | ||
import { fetchViaHTTP } from 'next-test-utils' | ||
import { createNext, FileRef } from 'e2e-utils' | ||
import { NextInstance } from 'test/lib/next-modes/base' | ||
|
||
jest.setTimeout(2 * 60 * 1000) | ||
|
||
export function runTests(example = '') { | ||
let next: NextInstance | ||
|
||
beforeAll(async () => { | ||
const srcDir = join(__dirname, '../../../../examples', example) | ||
const srcFiles = await fs.readdir(srcDir) | ||
|
||
const packageJson = await fs.readJson(join(srcDir, 'package.json')) | ||
|
||
next = await createNext({ | ||
files: srcFiles.reduce((prev, file) => { | ||
if (file !== 'package.json') { | ||
prev[file] = new FileRef(join(srcDir, file)) | ||
} | ||
return prev | ||
}, {} as { [key: string]: FileRef }), | ||
dependencies: { | ||
...packageJson.dependencies, | ||
...packageJson.devDependencies, | ||
}, | ||
installCommand: ({ dependencies }) => { | ||
const pkgs = Object.keys(dependencies).reduce((prev, cur) => { | ||
prev.push(`${cur}@${dependencies[cur]}`) | ||
return prev | ||
}, [] as string[]) | ||
return `yarn set version berry && yarn config set enableGlobalCache true && yarn config set compressionLevel 0 && yarn add ${pkgs.join( | ||
' ' | ||
)}` | ||
}, | ||
buildCommand: `yarn next build --no-lint`, | ||
startCommand: (global as any).isNextDev ? `yarn next` : `yarn next start`, | ||
}) | ||
}) | ||
afterAll(() => next?.destroy()) | ||
|
||
it(`should compile and serve the index page correctly ${example}`, async () => { | ||
const res = await fetchViaHTTP(next.url, '/') | ||
expect(res.status).toBe(200) | ||
expect(await res.text()).toContain('<html') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('with-eslint') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('with-mdx') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('with-next-sass') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('with-styled-components') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runTests } from './utils' | ||
|
||
describe('yarn PnP', () => { | ||
runTests('with-typescript') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.