-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[infra] Improve test setup #18228
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
[infra] Improve test setup #18228
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ export default mergeConfig(sharedConfig, { | |
test: { | ||
name: getTestName(import.meta.url), | ||
environment: 'browser', | ||
setupFiles: [new URL('../../test/utils/setupPickers.js', import.meta.url).pathname], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% sure, but I'd expect this could be broken on windows. Perhaps you want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were already using this pattern There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say you always want to use Different case, but I remember someone having their projects in a folder with a dot and this breaking a script that assumes only paths for files can contain a dot. Naturally most people won't have this dot, so the issue remains invisible for a long time and will be hard to debug once it appears. In this case it even affected publishing of stable releases. Conclusion: always use the built-in functions for manipulating urls and paths, even if it looks trivial and seems to work. This is something you can be religious about in my experience. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
browser: { | ||
enabled: true, | ||
instances: [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,13 @@ export default defineConfig({ | |
provider: 'playwright', | ||
headless: true, | ||
screenshotFailures: false, | ||
orchestratorScripts: [ | ||
{ | ||
id: 'vitest-reload-on-error', | ||
content: `window.addEventListener('vite:preloadError', (event) => { window.location.reload(); });`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
async: true, | ||
}, | ||
], | ||
}, | ||
// Disable isolation to speed up the tests. | ||
isolate: false, | ||
|
Uh oh!
There was an error while loading. Please reload this page.