Skip to content

Conversation

@Skn0tt
Copy link
Member

@Skn0tt Skn0tt commented Nov 17, 2025

Mirrors microsoft/playwright-vscode#706 into UI mode.

@Skn0tt Skn0tt requested a review from dgozman November 17, 2025 09:50
@Skn0tt Skn0tt self-assigned this Nov 17, 2025
@Skn0tt
Copy link
Member Author

Skn0tt commented Nov 17, 2025

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.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Skn0tt
Copy link
Member Author

Skn0tt commented Nov 17, 2025

Looks like a problem with windows paths.

@github-actions

This comment has been minimized.

@github-actions

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]);
Copy link
Contributor

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.

Copy link
Member Author

@Skn0tt Skn0tt Nov 18, 2025

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!

@github-actions

This comment has been minimized.

@Skn0tt Skn0tt requested a review from dgozman November 18, 2025 11:10
@github-actions
Copy link
Contributor

Test results for "MCP"

2432 passed, 116 skipped


Merge workflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-library] › library/page-clock.spec.ts:264 › stubTimers › replaces global performance.now `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node18`

40312 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>) => {
Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Member Author

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;
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree! #38235 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants