-
Notifications
You must be signed in to change notification settings - Fork 760
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
Fix Browser CI #3369
Fix Browser CI #3369
Conversation
d06d988
to
4a57122
Compare
import { nodePolyfills } from 'vite-plugin-node-polyfills' | ||
import wasm from 'vite-plugin-wasm' | ||
|
||
const config = defineConfig({ |
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.
const config = defineConfig({ | |
// https://vitest.dev/config/ | |
const config = defineConfig({ |
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.
@roninjin10 do you have any insights on why an arbitrary browser test script seems to always fail on CI? All of our browser tests pass locally but when they run on CI, we get these failed to resolve dynamically imported module...
errors. I've tried all manner of config settings trying to remove parallel test runs and isolated environments, etc, with no success. At this point, I haven't come up with a reproducible "minimal" build to point the vitest devs at so have hesitated to open an issue there (though may do so soon)
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.
@acolytec3 try setting VITEST_BROWSER_DEBUG=true
environment variable
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.
Btw if the debug logging doesn't provide any insight let me know I'd be happy to look at this
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 just keeps doing this sort of thing - https://github.com/ethereumjs/ethereumjs-monorepo/actions/runs/8943487337/job/24568309037#step:9:74
Debug logging doesn't seem to tell me anything more. It's not always the tx
test run that fails either. I can comment out tx
and another one will fail the same way (or I can tell vitest to skip the one test file that's not being loaded and it will still fail on tx
with a different file having no tests fail). Very weird.
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 seems to have started after vitest v1.5.1 was released
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.
If you don't have a quick instinct on it, I'll just open an issue on vitest and see if they're willing to look at our vitest config since I don't know how else to reproduce it.
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 not always the tx test run that fails either. I can comment out tx and another one will fail the same way (or I can tell vitest to skip the one test file that's not being loaded and it will still fail on tx with a different file having no tests fail). Very weird.
oh that is really wierd and definitely smells like an internal race condition bug in vitest
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.
That was my instinct as well. Will report it and see if they're willing to help.
Have restarted CI since blockchain and state tests were failing (a bit unexpectedly + couldn't get anything out of the logs) |
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.
LGTM, great! 🎉
- run: npm run test:browser -w=@ethereumjs/evm | ||
- run: npm run test:browser -w=@ethereumjs/vm | ||
- run: npm run test:browser -w=@ethereumjs/verkle | ||
- run: npm run test:browser --workspaces --if-present |
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.
🙏
@@ -1,51 +0,0 @@ | |||
name: E2E Hardhat Tests |
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.
Hardhat out, yeah, guess that makes sense.
Not so realistic we'll give this so much attention again in the future.
exclude: [ | ||
...configDefaults.exclude, | ||
// readDirSync method not provided fs mock for vite | ||
'test/precompiles/eip-2537-bls.spec.ts', |
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.
Guess this can be removed again (?) after BLS merge
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.
Update: just tested and realized it's another thing
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.
Yep, there are probably several of these where the mock that vitest injects a polyfill that's not fully mapping to the node builtin we're referencing.
Fixes browser tests