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
Update yarn PnP tests and disable swc file reading for PnP #33236
Merged
Merged
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
644a278
Update yarn PnP tests and disable swc file reading for PnP
ijjk 1106a5a
update job
ijjk 12d6bf4
Update test
ijjk 669d6d7
add env variable
ijjk 0695815
update destory
ijjk c8d2fcc
test one
ijjk 646f856
bump timeout
ijjk 991f6b0
update pnp install command
ijjk 0fd5b6e
only run pnp test
ijjk ee22285
add more logs
ijjk 719d4dc
handle exit signal
ijjk 369d023
dont inherit stdio for install
ijjk 1cfa2bd
update server start
ijjk 218e396
re-add test type
ijjk e9c5677
add build log
ijjk 9500633
additional logging
ijjk 8bb963a
update build command
ijjk 9aaa18c
remove separate timeout
ijjk c0a3d48
update install command
ijjk 0fd6bd0
install separate for better time info
ijjk a100a1d
add cache pre-warming
ijjk f9de7fd
update yarn config
ijjk c38011f
enable other pnp tests
ijjk 0766c3b
Separate out tests
ijjk cc86f89
fix-lint
ijjk fed6184
update path
ijjk 3a6e924
update test concurrency for isolated tests
ijjk 4925c87
update retries
ijjk 0536c9c
Revert "update test concurrency for isolated tests"
ijjk d794a87
re-enable production tests
ijjk 27c84ba
Merge branch 'canary' into fix/yarn-pnp-tests
ijjk f6d719f
Merge branch 'canary' into fix/yarn-pnp-tests
ijjk 0e8a91e
apply suggestions
ijjk File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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( | ||
ijjk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
' ' | ||
)}` | ||
}, | ||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird - why isn't
EXCLUDED_PATHS
enough? 🤔 Isthis.resourcePath
the right parameter? Looking at the report in #31812 (comment) it shows that the reported path should match:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex doesn't seem to match the above case:It seems to safer to avoid this slight optimization for the PnP case, although if it is a noticeable difference in performance we could update the regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you need to escape the backslashes in the literal for the regex to match:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, hmm yeah I'm not able to find any mis-matches shared in the errors from the threads 🤔