-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 (core): filter different projects in watch mode #7146
base: main
Are you sure you want to change the base?
fix (core): filter different projects in watch mode #7146
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
f41276b
to
057e610
Compare
@@ -830,11 +830,12 @@ export class Vitest { | |||
} | |||
|
|||
const specifications = files.flatMap(file => this.getModuleSpecifications(file)) |
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 should already return only filtered projects because it uses vitest.projects
and not vitest.resolvedProjects
. Why doesn't it?
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.
Yes, but in those cases where we have different projects defined by defineProject
, the filter of files.flatMap(file => this.getModuleSpecifications(file))
is returning TestProjects beyond what it should.
Because of this, one of the possible solutions would be to apply the filter by 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.
You just rephrased what I asked. Why does it do that? getModuleSpecification
shouldn't include filtered out projects
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.
Sorry, now I understand your question...
getModuleSpecification
has the following validation:
const _cached = this.getCachedSpecifications(moduleId)
if (_cached) {
return _cached
}
When we are re-running the tests with the filters along with --watch
it ends up returning the cache projects instead of trying to search again. (Another solution would be to simply remove this validation and cache return).
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.
@sheremet-va Do you have any idea what paths we can take to solve the problem? Insert validation into specificationsWithFilterByProject
or remove cache validation for getModuleSpecification
?
0113ff3
to
bac2ef7
Compare
Description
closes #7131
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:
.