-
-
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): replace navigation with test explorer #5854
Conversation
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 might be missing something wrt the requestAnimationFrame
loop cleanup. Looks like there's a leak.
Latest changes:
There are 2 todos in the code @sheremet-va :
I'm going to include |
await rpcDone() | ||
await client.rpc.finishBrowserTests() | ||
} | ||
finally { |
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.
Why is this needed? Finishing should be done in onFinished
hook in UI (done
always triggers onFinished
)
(please answer directly here and not in Discord)
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.
not being called
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 being called without files and with errors, I'm going to check what's happening, maybe the logic must be updated for browser mode.
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.
Calling finishBrowserTests
resolves this promise:
await promise |
Which in turn resolves this:
vitest/packages/vitest/src/node/core.ts
Line 636 in 07876b7
await this.pool.runTests(specs, invalidates) |
Which should always call onFinished
here:
vitest/packages/vitest/src/node/core.ts
Line 655 in 07876b7
await this.report('onFinished', this.state.getFiles(files), this.state.getUnhandledErrors(), coverage) |
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.
done
being called 3/4 times (I added a breakpoint)... will onFinished
being called only once, the first time the promise is resolved? Then the client can receive some onTaskUpdate
and the state will be reset to running
again
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.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
Looks like it is a bug in @vitest/runner
- it should wait until all onTaskUpdate
are resolved before finishing runTests
I'm going to submit a new PR with latest changes in main, you can check this video. These are the pending tasks (can be added progressively):
✔️ we need to remove a few sfc files and composable modules (I'll keep all to check old behavior):
To run some ui tests:
|
closing, superseded by #5907 |
Description
This PR changes the navigation to match the test explorer in VSCode extension:
test/core
)useVirtualScroll
from VueUse, we need to use another vue library since the tasks will have children (suite/tests...) (with children expanded the VueUse virtual scroll will not handle the height properly)setInterval
to collect the summary state incomposables/test-state.ts
(this PR will not usecomposables/summary.ts
): we need to adjust the timeout, we cannot usesetTimeout
approach, the server will not handle backpressure and the ui can miss a lot of ticks (check_collect
function incomposables/test-state.ts
)id
and reload the task when the id changes@vitest/ws-client
to change the reactivity based on the data (checkVitestClientOptions
andcreateClient
), the current version will usereactive
for all, that's, files, file ids and stateMaybe we need to move the logic to collect global state to the server, this way the client will just receive the data to be displayed in the ui.
Second run: the server finished and the client still processing incoming data
Second run: the CPU 100%, once server finish only 1 core (without dev tools)
Vitest Browser tests (preview provider)
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:
.