-
-
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
feat(ui): allow run individual tests/suites from the UI #6641
feat(ui): allow run individual tests/suites from the UI #6641
Conversation
chore: update run button title based on type
packages/vitest/src/node/core.ts
Outdated
await this.changeNamePattern( | ||
task.name, | ||
[task.file.filepath], | ||
this.isSuite(task) ? 'rerun suite' : 'rerun test', |
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.
task.type === 'suite'
is how you check for suite, no need for extra function
packages/vitest/src/node/core.ts
Outdated
|
||
async rerunTask(id: string) { | ||
const task = this.state.idMap.get(id) | ||
if (task) { |
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.
maybe we should throw an error if task it not found?
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.
yeah, I'll ask you about this... or maybe we can rerun all files or passing the filename back again and rerun all tasks in the 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.
I think an error is better
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.
just throw an error?
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.
yeah, something like Task ${id} was not found
Looks good! There are a few conflicts though |
…l-tests-and-suites # Conflicts: # packages/ui/client/components/explorer/ExplorerItem.vue # packages/ui/client/composables/client/index.ts # packages/vitest/src/node/core.ts
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Sorry to ask, but can you resolve the conflict again? |
…l-tests-and-suites # Conflicts: # packages/vitest/src/node/core.ts
Description
We need this PR #6405
Since we don't have the full tree in the state (missing parent in task), the client will send the task id, the children ids and all parent ids: parent ids are required to avoid mark the test not being run as skipped and so their state will not change.
We also need to reset
configOverride.testNamePattern
when re-running some file (including all files), otherwise we can only re-run previous test/suite run, maybe we can have some side effect here (I need to do some additional tests).Caution
Right now the command line will skip other tests/suites not matching the pattern (using t + regexp): the problem with the UI is about enabling/disabling re-run button, disabled when test/suite without state or state with
skip
ortodo
value (check command line filter behaviour screenshot below)Warning
We should add the
test "path"
when filtering tests/suites (check filtering from command line screenshot below)resolves #6638
filtering from command line
command line filter behaviour
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:
.