-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Run a single test command in CI #4007
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
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
584e217
Run a single test command in CI
nstepien f54687a
add link to bug
nstepien cb96800
cleaner
nstepien 94671ab
test changing screenshot name, screenshot failure, and adding new scr…
nstepien 9ce9dd0
don't pass a glob string to rm
nstepien 38461b6
remove soft failure
nstepien 0d9f6a9
Update screenshots
github-actions[bot] 34c6cf6
tweak git config, reset test
nstepien 9ca0426
Update screenshots
nstepien File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,15 +1,17 @@ | ||
| /.cache | ||
| /.claude | ||
| /coverage | ||
| /dist | ||
| /lib | ||
| /node_modules | ||
| /package-lock.json | ||
| test/browser/**/__screenshots__ | ||
|
|
||
| npm-debug.log | ||
| **.orig | ||
| .idea | ||
| .vitest-attachments | ||
|
|
||
| __traces__ | ||
| # Vitest | ||
| /.vitest-attachments | ||
| /coverage | ||
| /test/**/__screenshots__ | ||
| /test/**/__traces__ | ||
| /test/**/screenshots/**/*-win32.png | ||
This file contains hidden or 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 hidden or 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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -39,30 +39,31 @@ const dragFill: BrowserCommand<[from: string, to: string]> = async ({ page, ifra | |
| await page.mouse.up(); | ||
| }; | ||
|
|
||
| const actionTimeout = 2000; | ||
| const viewport = { width: 1920, height: 1080 } as const; | ||
| const playwrightOptions: PlaywrightProviderOptions = { | ||
| actionTimeout, | ||
| contextOptions: { | ||
| viewport | ||
| } | ||
| }; | ||
|
|
||
| // vitest modifies the instance objects, so we cannot rely on static objects | ||
| // https://github.com/vitest-dev/vitest/issues/9877 | ||
| function getInstances(): BrowserInstanceOption[] { | ||
| const opts: PlaywrightProviderOptions = { | ||
| actionTimeout: 2000, | ||
| contextOptions: { | ||
| viewport | ||
| } | ||
| }; | ||
|
|
||
| return [ | ||
| { | ||
| browser: 'chromium', | ||
| provider: playwright({ | ||
| ...opts, | ||
| ...playwrightOptions, | ||
| launchOptions: { | ||
| channel: 'chromium' | ||
| } | ||
| }) | ||
| }, | ||
| { | ||
| browser: 'firefox', | ||
| provider: playwright(opts), | ||
| provider: playwright(playwrightOptions), | ||
| // TODO: remove when FF tests are stable | ||
| fileParallelism: false | ||
| } | ||
|
|
@@ -74,6 +75,7 @@ export default defineConfig( | |
| base: '/react-data-grid/', | ||
| cacheDir: '.cache/vite', | ||
| clearScreen: false, | ||
| define: isTest ? { __IS_CI__: JSON.stringify(isCI) } : {}, | ||
| build: { | ||
| modulePreload: { polyfill: false }, | ||
| sourcemap: true, | ||
|
|
@@ -107,15 +109,20 @@ export default defineConfig( | |
| }, | ||
| restoreMocks: true, | ||
| sequence: { | ||
| shuffle: true | ||
| shuffle: { | ||
| files: false, | ||
| tests: true | ||
| } | ||
| }, | ||
| expect: { | ||
| poll: { | ||
| timeout: actionTimeout | ||
| } | ||
| }, | ||
| slowTestThreshold: 1000, | ||
| projects: [ | ||
| { | ||
| extends: true, | ||
| define: { | ||
| __IS_CI__: JSON.stringify(isCI) | ||
| }, | ||
| test: { | ||
| name: 'browser', | ||
| include: ['browser/**/*.test.*'], | ||
|
|
@@ -141,7 +148,21 @@ export default defineConfig( | |
| viewport, | ||
| headless: true, | ||
| ui: false, | ||
| screenshotFailures: false | ||
| expect: { | ||
| toMatchScreenshot: { | ||
| resolveScreenshotPath({ | ||
| root, | ||
| testFileDirectory, | ||
| testFileName, | ||
| arg, | ||
| browserName, | ||
| platform, | ||
| ext | ||
| }) { | ||
| return `${root}/${testFileDirectory}/screenshots/${testFileName}/${arg}-${browserName}-${platform}${ext}`; | ||
|
Collaborator
Author
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 can properly differentiate between failure screenshots and test screenshots. |
||
| } | ||
| } | ||
| } | ||
| }, | ||
| setupFiles: ['test/setupBrowser.ts', 'test/failOnConsole.ts'] | ||
| } | ||
|
|
||
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.
Added the
win32.pngline so I'm not inconvenienced when testing things locally