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

feat: improve watcher performance, add forceRerunTriggers option #1424

Merged
merged 5 commits into from Jun 5, 2022

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Jun 4, 2022

Few things to note here:

  • watchIgnore is renamed to watchExclude
  • watchExclude now accepts only glob patterns

Now, instead of ignoring a file for rerun, we don't even watch for it. This should improve errors in docker about too much watches, and generally improve performance, because no more excessive calls.

  • added forceRerunTriggers option
  • forceRerunTriggers accepts glob pattern for files, that if changed, will cause a full suite rerun
  • forceRerunTriggers respects watchExclude

It is useful, when running CLI tests, because Vite cannot build a module graph for exec calls

@netlify
Copy link

netlify bot commented Jun 4, 2022

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a5011c3
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/629c4cb53806fe00086ebf86
😎 Deploy Preview https://deploy-preview-1424--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 settings.

@antfu
Copy link
Member

antfu commented Jun 4, 2022

What's dumb stands for?

@sheremet-va
Copy link
Member Author

sheremet-va commented Jun 4, 2022

What's dumb stands for?

"not smart" 👀

I've recently worked on a project involving dumb routers, so I thought why not 😄 Also, the name was proposed as a joke in discord :P

@jgoux
Copy link
Contributor

jgoux commented Jun 4, 2022

What's dumb stands for?

"not smart" 👀

I've recently worked on a project involving dumb devices, so I thought why not 😄 Also, the name was proposed as a joke in discord :P

Sorry for this terrible joke. 😂

If the default watch mode is "smart", maybe instead we could have a --watchMode=smart|dumb, and if watchMode is set to dumb, then we could have watchInclude taken into account?

If the word dumb is an issue here are alternatives:

  • graph|simple
  • smart|simple
  • automatic|manual

if (this.config.watchIgnore)
this.console.error(c.dim('ignore: ') + c.yellow(this.config.watchIgnore.join(comma)))
if (this.config.watchExclude)
this.console.error(c.dim('ignore: ') + c.yellow(this.config.watchExclude.join(comma)))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.console.error(c.dim('ignore: ') + c.yellow(this.config.watchExclude.join(comma)))
this.console.error(c.dim('exclude: ') + c.yellow(this.config.watchExclude.join(comma)))

Copy link
Member Author

Choose a reason for hiding this comment

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

I think exclude is a bit misleading. Renamed to watch exclude

@sheremet-va sheremet-va changed the title feat: improve watcher performance, add dumbWatchInclude option feat: improve watcher performance, add forceRerunTriggers option Jun 5, 2022
@sheremet-va sheremet-va requested a review from antfu June 5, 2022 13:15
@antfu antfu merged commit 3f5ff5b into vitest-dev:main Jun 5, 2022
@MichaelDeBoey
Copy link

watchIgnore is renamed to watchExclude

This wasn't clear watching only the changelog

@sheremet-va
Copy link
Member Author

watchIgnore is renamed to watchExclude

This wasn't clear watching only the changelog

Sorry, thank you for pointing that out. Will do better next time.

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

Successfully merging this pull request may close these issues.

None yet

4 participants