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: check related against forceRerunTriggers #1595

Merged
merged 13 commits into from Jul 5, 2022

Conversation

elliotwestlake
Copy link
Contributor

@elliotwestlake elliotwestlake commented Jul 4, 2022

If forceRerunTriggers has globs in it then we use micromatch to see if there's a file in related that should trigger the whole test suite

Was going to write some tests for this, but not sure where they should go

Resolves: #1592

@netlify
Copy link

netlify bot commented Jul 4, 2022

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 273a7c8
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/62c3ee84e40fd5000911849f
😎 Deploy Preview https://deploy-preview-1595--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.

Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

LGTM except for lock file

pnpm-lock.yaml Outdated Show resolved Hide resolved
@sheremet-va
Copy link
Member

Was going to write some tests for this, but not sure where they should go

I don't think we have unit tests for those, but we have test/related. You can add integration test there. You will need to call tests with custom config vitest related some-file.js -c custom-config-with-force-rerun.js:

// package.json
{
  "scripts": {
    "test": "nr test:related && nr test:rerun",
    "test:related": "<current test command>",
    "test:rerun": "<your test command>"
  }
}

@sheremet-va
Copy link
Member

Also, please, add more information to the docs of --changed and --forceRerunTriggers.

pnpm-lock.yaml Outdated Show resolved Hide resolved
@elliotwestlake elliotwestlake changed the title feat: check related against forceRerunTriggers feat: check related against forceRerunTriggers Jul 4, 2022
pnpm-lock.yaml Outdated Show resolved Hide resolved
test/related/tests/force-rerun.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

LGTM

@sheremet-va
Copy link
Member

sheremet-va commented Jul 5, 2022

@elliotwestlake should we add new defaults to forceRerunTriggers? 🤔 Like package.json, maybe vitest.config.*, vite.config.* 🤔 (maybe dist? anything else?)

If yes, this should also be specified in docs.

@elliotwestlake
Copy link
Contributor Author

@elliotwestlake should we add new defaults to forceRerunTriggers? 🤔 Like package.json, maybe vitest.config.*, vite.config.* 🤔 (maybe dist? anything else?)

If yes, this should also be specified in docs.

Great idea, will add them and any others I can think of!

@elliotwestlake
Copy link
Contributor Author

@sheremet-va @antfu Defaults added, ready to merge when you are

@sheremet-va sheremet-va enabled auto-merge (squash) July 5, 2022 07:46
auto-merge was automatically disabled July 5, 2022 07:55

Head branch was pushed to by a user without write access

@elliotwestlake
Copy link
Contributor Author

elliotwestlake commented Jul 5, 2022

@sheremet-va Any chance you could enable auto-merge again please? The checks weren't running with your commit for some reason

@sheremet-va sheremet-va enabled auto-merge (squash) July 5, 2022 07:57
@sheremet-va sheremet-va merged commit 40fc526 into vitest-dev:main Jul 5, 2022
@elliotwestlake elliotwestlake deleted the rerun-tests-in-forcererun branch July 5, 2022 08:10
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.

Rerun all tests when package.json changes
3 participants