-
-
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: apply retry
and bail
from test config file
#4530
Merged
sheremet-va
merged 3 commits into
vitest-dev:main
from
hi-ogawa:fix-global-retry-config
Nov 18, 2023
Merged
fix: apply retry
and bail
from test config file
#4530
sheremet-va
merged 3 commits into
vitest-dev:main
from
hi-ogawa:fix-global-retry-config
Nov 18, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
hi-ogawa
commented
Nov 18, 2023
Comment on lines
127
to
137
function debug(obj: object) { | ||
return Object.fromEntries(Object.entries(obj).filter(([k, _v]) => ['retry', 'bail', 'segfaultRetry'].includes(k))) | ||
} | ||
console.log('== configResolved (before)', [debug(options), debug(viteConfigTest)]) | ||
options = deepMerge( | ||
{}, | ||
configDefaults, | ||
viteConfigTest, | ||
options, | ||
) | ||
console.log('== configResolved (after)', [debug(options)]) |
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.
When using cac's default
value, this debug logging looks like this:
== configResolved (before) [ { segfaultRetry: 0, bail: 0, retry: 0 }, { retry: 3, bail: 4 } ]
== configResolved (after) [ { retry: 0, bail: 0, segfaultRetry: 0 } ]
It shows viteConfigTest
has no effect for bail
and retry
since options
from cli has precedence over viteConfigTest
.
hi-ogawa
changed the title
fix: fix test config for
fix: apply Nov 18, 2023
retry
and bail
retry
and bail
test config
hi-ogawa
changed the title
fix: apply
fix: apply Nov 18, 2023
retry
and bail
test configretry
and bail
from test config file
sheremet-va
approved these changes
Nov 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #4490
I found that
retry
andbail
options from config file didn't have any effect sincecac
's default0
value is preventing from user test config to overwrite the value.I saw other option (e.g.
--test-timeout
introduced in #3019) is using"... (default: ...)"
in help message instead of relying on{ default: ... }
, so this PR does similarly forretry
andbail
.When
retry
config is introduced in #3603, the corresponding test is added astest/config/fixtures/retry
which makes use oftest.retry
config, but this was not testing cli scenario since this test is executed viastartVitest
.vitest/test/config/fixtures/retry/vitest.config.ts
Line 6 in fe31447
So, to verify this PR, I modified this existing test to use
runVitestCli
.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:
.