-
Notifications
You must be signed in to change notification settings - Fork 5
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
[tests] A better sandboxing of tests and builds #123
base: yoann/add-more-injection-points
Are you sure you want to change the base?
[tests] A better sandboxing of tests and builds #123
Conversation
.node-version
Outdated
@@ -1 +1 @@ | |||
18.19.0 | |||
18.20.5 |
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.
do we still need this file?
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.
probably not.
`Invalid "${red(`--bundlers ${REQUESTED_BUNDLERS.join(',')}`)}".\nValid bundlers are ${FULL_NAME_BUNDLERS.map( | ||
(b) => green(b), | ||
) | ||
.sort() |
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.
why are you sorting this static array? If you want it sorted, shouldn't the base static array be already pre-sorted?
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.
absolutely not sure why I did this.
return path.resolve(workingDir, `./dist/${folderName}`); | ||
}; | ||
|
||
const FIXTURE_DIR = path.resolve(__dirname, '../fixtures'); |
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.
Not a blocker, but __dirname
doesn't exist in ESM, only in CJS. Idk if this can create issues or not
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.
I'll update once we transition to esm.
@@ -315,4 +322,4 @@ export const filterOutParticularities = (input: File) => | |||
// Exclude webpack buildin modules, which are webpack internal dependencies. | |||
!input.filepath.includes('webpack4/buildin') && | |||
// Exclude webpack's fake entry point. | |||
!input.filepath.includes('fixtures/project/empty.js'); | |||
!input.filepath.includes('fixtures/empty.js'); |
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.
prefer .endsWith
to .includes
, to avoid something like fixtures/empty.js/hello.js
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.
fair.
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.
🤔 actually, given the context, I think we might also get fixtures/empty.js?something
since it's within the bundling.
I've seen weird shit with the commonjs plugins for instance 😄
I prefer to filter out any mention of this path, which is also pretty much well under control.
@@ -33,7 +33,7 @@ jobs: | |||
- name: Install node | |||
uses: actions/setup-node@v4 | |||
with: | |||
node-version: '18.19.0' | |||
node-version: '18.x' |
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.
Just FYI, the setup-node
action can be configured to use the exact same version as volta.
Could be handy!
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.
super useful, thanks!
What and why?
After #121 it proved to be super difficult not to leak in between builds.
We need to better sandbox our fixture projects and our builds from each others to avoid any leakage in between.
How?
--cleanup=0
to prevent deletion of the temporary directories where builds happen.--bundlers=webpack4,...
to only build for a specific bundler.--build
to force build the plugins before running the tests.runBundlers()
) it will create a new temporary directory, copy the fixture projects in it, and run the build in isolation.