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

fix: rewrite benchmark reporter without log-update #7019

Merged
merged 3 commits into from
Dec 26, 2024

Conversation

AriPerkkio
Copy link
Member

@AriPerkkio AriPerkkio commented Dec 4, 2024

Description

Test preview release with:

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9c9e69b
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/676c3dc88a0d4f0008fb9abc
😎 Deploy Preview https://deploy-preview-7019--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 configuration.

Copy link

pkg-pr-new bot commented Dec 4, 2024

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@7019

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@7019

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@7019

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@7019

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@7019

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@7019

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@7019

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@7019

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@7019

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@7019

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@7019

vite-node

npm i https://pkg.pr.new/vite-node@7019

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@7019

vitest

npm i https://pkg.pr.new/vitest@7019

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@7019

commit: 5bb20e1

@AriPerkkio AriPerkkio force-pushed the fix/rewrite-bench-reporter branch 5 times, most recently from 3dc0b49 to b1c700c Compare December 11, 2024 09:41
@AriPerkkio
Copy link
Member Author

Looks like benchmark runner is reporting tests of nested suites twice. Need to resolve this, otherwise summary is showing too high test count.

@sheremet-va
Copy link
Member

Does this also add a project name to the output? I just noticed we don't print |name|

@AriPerkkio
Copy link
Member Author

Project name is visible now:

@AriPerkkio
Copy link
Member Author

It's not in table output though, should it be here too?

@sheremet-va
Copy link
Member

It's not in table output though, should it be here too?

Yeah

@AriPerkkio AriPerkkio force-pushed the fix/rewrite-bench-reporter branch 2 times, most recently from 2316cf1 to 8a19faa Compare December 13, 2024 15:26
@AriPerkkio AriPerkkio marked this pull request as ready for review December 13, 2024 16:56
@@ -135,16 +137,6 @@ async function runBenchmarkSuite(suite: Suite, runner: NodeBenchmarkRunner) {
suite.result!.duration = performance.now() - start
suite.result!.state = 'pass'

tasks
Copy link
Member

Choose a reason for hiding this comment

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

Did you move the sorting? Why is it removed from here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's moved to main thread's side, so that we don't need to report tasks twice as 'pass'.

  • Created failing test case first: d4223fd
  • Then moved sorting to the other side of RPC: 9ed93b5

There's test/benchmark/test/reporter.test.ts that fails if this sorting and result.benchmark.rank setting is wrong.

@AriPerkkio AriPerkkio force-pushed the fix/rewrite-bench-reporter branch 2 times, most recently from 0965c72 to 3e9a9b7 Compare December 19, 2024 07:13
hi-ogawa
hi-ogawa previously approved these changes Dec 23, 2024
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Looks good! Tested radashi locally and the improvement is awesome 👏

About tinyexec patch, it's not a blocker, but the situation is not ideal since patch is only applied for our local dev, but tinyexec is also used for external dependencies in a few places.

@AriPerkkio
Copy link
Member Author

About tinyexec patch, it's not a blocker, but the situation is not ideal since patch is only applied for our local dev, but tinyexec is also used for external dependencies in a few places.

I agree. I'll replace tinyexec usage+patching with node:child_process or maybe even startVitest when using preserveAnsi option from https://github.com/vitest-dev/vitest/pull/7090/files#diff-eee947831abd0685dc52e26f42f2c7c3adfb802e478ca8e252ba649f1a1ab2f6R5-R13.

@AriPerkkio AriPerkkio force-pushed the fix/rewrite-bench-reporter branch 2 times, most recently from 45ba01c to c9ad5fd Compare December 25, 2024 18:52
@AriPerkkio AriPerkkio force-pushed the fix/rewrite-bench-reporter branch from c9ad5fd to 5bb20e1 Compare December 25, 2024 19:52
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Thanks!

@AriPerkkio AriPerkkio merged commit 6d23f4b into vitest-dev:main Dec 26, 2024
14 checks passed
@AriPerkkio AriPerkkio deleted the fix/rewrite-bench-reporter branch December 26, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmark output can be improved
3 participants