-
Notifications
You must be signed in to change notification settings - Fork 4.8k
chore(ui): always pass test locations to skip loading unnecessary test files #38235
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
base: main
Are you sure you want to change the base?
Conversation
|
The second commit is a breaking change for the VS Code extension, so we can only merge it after the update to the extension was released. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Looks like a problem with windows paths. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| }); | ||
| }, [projectFilters, isRunningTest, testModel, testServerConnection, updateSnapshots, singleWorker]); | ||
|
|
||
| const runVisibleTests = React.useCallback(() => runTests('bounce-if-busy', visibleTestIds, new Set(queryParams.args)), [runTests, visibleTestIds]); |
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 am not sure how queryParams.args integrates here. Could you please explain? I'd assume we always use collectTestIds() when running tests, and use queryParams.args when listing to filter things, but I'm not exactly sure.
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 wanted to make it as much of a mechanical refactoring as possible, so I didn't think too closely about the meaning here. We passed queryParams.args into locations before, and we used visibleTestIds here for reasons unbeknownst to me. So I kept it the same.
I refactored it now and was able to remove a bunch of code, so that's great!
Co-authored-by: Dmitry Gozman <[email protected]> Signed-off-by: Simon Knott <[email protected]>
This comment has been minimized.
This comment has been minimized.
Test results for "MCP"2432 passed, 116 skipped Merge workflow run. |
Test results for "tests 1"3 flaky40312 passed, 787 skipped Merge workflow run. |
| }, [filterText, testModel, statusFilters, projectFilters, runningState, isRunningTest, mergeFiles]); | ||
|
|
||
| const runTests = React.useCallback((mode: 'queue-if-busy' | 'bounce-if-busy', testIds: Set<string>) => { | ||
| const runTests = React.useCallback((mode: 'queue-if-busy' | 'bounce-if-busy', testTree: TestTree, testItems: Iterable<TreeItem>) => { |
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 don't like that we pass TestTree here, especially when it differs from testTree declared on the line 249. Can we pass testIds + locations instead? Perhaps introduce a type for this pair.
| } else if (e.code === 'F5') { | ||
| e.preventDefault(); | ||
| runTests('bounce-if-busy', visibleTestIds); | ||
| runVisibleTests(); |
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 use visibleTestIds anywhere?
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.
nope, I removed it
| config.cliListOnly = false; | ||
| config.cliPassWithNoTests = true; | ||
| config.cliArgs = params.locations || []; | ||
| config.cliArgs = params.locations; |
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.
This is not backwards-compatible, so older VSCode extension won't be able to run tests. We should update the extension first.
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.
totally agree! #38235 (comment)
Mirrors microsoft/playwright-vscode#706 into UI mode.