feat(ui): replace navigation with test explorer#5854
Conversation
JessicaSachs
left a comment
There was a problem hiding this comment.
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.
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.
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.
Calling finishBrowserTests resolves this promise:
Which in turn resolves this:
vitest/packages/vitest/src/node/core.ts
Line 636 in 07876b7
Which should always call onFinished here:
vitest/packages/vitest/src/node/core.ts
Line 655 in 07876b7
There was a problem hiding this comment.
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
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
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)useVirtualScrollfrom 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)setIntervalto collect the summary state incomposables/test-state.ts(this PR will not usecomposables/summary.ts): we need to adjust the timeout, we cannot usesetTimeoutapproach, the server will not handle backpressure and the ui can miss a lot of ticks (check_collectfunction incomposables/test-state.ts)idand reload the task when the id changes@vitest/ws-clientto change the reactivity based on the data (checkVitestClientOptionsandcreateClient), the current version will usereactivefor 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.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.