Skip to content
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

Conversation

DevJoaoLopes
Copy link
Contributor

@DevJoaoLopes DevJoaoLopes commented Dec 29, 2024

Description

closes #7131

  • This PR resolves a bug in watch (-watch) mode where the filter (w key) is not filtering only the tests of a given project

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Dec 29, 2024

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 715eaf3
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/677103f601658c00081ae386
😎 Deploy Preview https://deploy-preview-7146--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 29, 2024

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9f29f92
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/679209a4ae29d0000840cdb7
😎 Deploy Preview https://deploy-preview-7146--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@DevJoaoLopes DevJoaoLopes force-pushed the fix-filter-watch-mode-projects branch from f41276b to 057e610 Compare December 29, 2024 18:15
packages/vitest/src/node/core.ts Outdated Show resolved Hide resolved
test/filterWatchMode/package.json Outdated Show resolved Hide resolved
@DevJoaoLopes DevJoaoLopes force-pushed the fix-filter-watch-mode-projects branch from 0113ff3 to bac2ef7 Compare January 8, 2025 23:14
@DevJoaoLopes DevJoaoLopes force-pushed the fix-filter-watch-mode-projects branch from 8030438 to 21c776b Compare January 15, 2025 23:47
Copy link
Contributor Author

@DevJoaoLopes DevJoaoLopes left a comment

Choose a reason for hiding this comment

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

Removed cache so we have the projects filtered properly.

@sheremet-va
Copy link
Member

Removed cache so we have the projects filtered properly.

I said "invalidate" the cache, not remove the if check

@DevJoaoLopes
Copy link
Contributor Author

Removed cache so we have the projects filtered properly.

I said "invalidate" the cache, not remove the if check

okay, then I'll have to think about how to do that

@DevJoaoLopes DevJoaoLopes force-pushed the fix-filter-watch-mode-projects branch from a72707e to b2c2b32 Compare January 19, 2025 23:25
@DevJoaoLopes
Copy link
Contributor Author

Removed cache so we have the projects filtered properly.

I said "invalidate" the cache, not remove the if check

okay, then I'll have to think about how to do that

@sheremet-va One of the ways to maintain this cache validation was to enter a condition to compare filtered projects by invalidating the cache when there are differences.

Copy link
Contributor Author

@DevJoaoLopes DevJoaoLopes left a comment

Choose a reason for hiding this comment

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

Insert validation for cache condition

@sheremet-va
Copy link
Member

sheremet-va commented Jan 23, 2025

#7313 rewrote how workspaces are filtered which fixed this issue too. Still, thank you for your effort!

@DevJoaoLopes DevJoaoLopes deleted the fix-filter-watch-mode-projects branch January 26, 2025 17:41
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.

Project filter is includes shared tests across projects
2 participants