-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(vm-threads): tests not cancelled on key press, cancelled tests shown twice #4781
fix(vm-threads): tests not cancelled on key press, cancelled tests shown twice #4781
Conversation
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
There's still one more bug to fix. Once tests have been interrupted and are re-run, the "skip status" of the tests is not reseted. Earlier this line has done it:
Skip status is set here: vitest/packages/vitest/src/node/state.ts Lines 153 to 168 in 9497f48
This bug is present on all pools. |
@@ -44,7 +44,7 @@ export function createBrowserPool(ctx: Vitest): ProcessPool { | |||
if (project.config.browser.isolate) { | |||
for (const path of paths) { | |||
if (isCancelled) { | |||
ctx.state.cancelFiles(files.slice(paths.indexOf(path)), ctx.config.root, project.getName()) | |||
ctx.state.cancelFiles(files.slice(paths.indexOf(path)), ctx.config.root, project.config.name) |
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 needs to match with the collected files:
vitest/packages/runner/src/collect.ts
Line 28 in 9497f48
projectName: config.name, |
This feels a bit hacky. The WorkspaceProject.getSerializableConfig()
always returns undefined
for .name
instead of ''
when there's no name set for the project (no workspaces used).
The state.clearFiles
uses the projectName
when comparing files. When they don't match, there can be duplicate entries where one is from collection and one from cancelling:
'/x/vitest-example-project/vitest/test/sum.2.test.js' => [
{
filepath: '/x/vitest-example-project/vitest/test/sum.2.test.js',
id: '/x/vitest-example-project/vitest/test/sum.2.test.js',
mode: 'skip', // <-- From test cancel
name: 'test/sum.2.test.js',
projectName: '',
type: 'suite',
...
},
{
filepath: '/x/vitest-example-project/vitest/test/sum.2.test.js',
mode: 'run', // <-- From test collect
name: 'test/sum.2.test.js',
type: 'suite',
...
}
],
These show up in reports like below:
Description
pool: 'vmThreads'
.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.