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

test(cli): migrate cli tests to vitest #7731

Merged
merged 2 commits into from
Nov 4, 2024

Conversation

binoy14
Copy link
Contributor

@binoy14 binoy14 commented Nov 1, 2024

Description

Migrates CLI tests to vitest

What to review

Changes makes sense

Testing

All tests should be passing for CLI tests

Notes for release

N/A

Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:52pm
performance-studio ✅ Ready (Inspect) Visit Preview Nov 1, 2024 4:52pm
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:52pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:52pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 4:52pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Nov 1, 2024 4:52pm

Copy link
Contributor Author

binoy14 commented Nov 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @binoy14 and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Nov 1, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Nov 1, 2024

Component Testing Report Updated Nov 1, 2024 4:49 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 32s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 39s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 11s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 2m 32s 1 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 46s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 19s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 27s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 19s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 37s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Nov 1, 2024

⚡️ Editor Performance Report

Updated Fri, 01 Nov 2024 16:52:04 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 15.2 efps (66ms) 15.4 efps (65ms) -1ms (-1.5%)
article (body) 54.8 efps (18ms) 53.2 efps (19ms) +1ms (+3.0%)
article (string inside object) 16.7 efps (60ms) 16.7 efps (60ms) +0ms (-/-%)
article (string inside array) 15.2 efps (66ms) 13.9 efps (72ms) +6ms (+9.1%)
recipe (name) 29.4 efps (34ms) 29.4 efps (34ms) +0ms (-/-%)
recipe (description) 33.3 efps (30ms) 33.3 efps (30ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (7ms) 99.9+ efps (7ms) +0ms (-/-%)
synthetic (title) 13.9 efps (72ms) 13.9 efps (72ms) +0ms (-/-%)
synthetic (string inside object) 13.9 efps (72ms) 14.5 efps (69ms) -3ms (-4.2%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 66ms 73ms 88ms 224ms 605ms 14.7s
article (body) 18ms 20ms 31ms 171ms 345ms 6.1s
article (string inside object) 60ms 66ms 88ms 312ms 599ms 9.5s
article (string inside array) 66ms 71ms 73ms 205ms 791ms 9.4s
recipe (name) 34ms 37ms 53ms 89ms 4ms 8.8s
recipe (description) 30ms 31ms 35ms 54ms 0ms 5.9s
recipe (instructions) 7ms 9ms 10ms 17ms 8ms 3.4s
synthetic (title) 72ms 77ms 86ms 383ms 1664ms 16.3s
synthetic (string inside object) 72ms 75ms 81ms 550ms 1547ms 10.6s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 65ms 69ms 77ms 199ms 582ms 14.9s
article (body) 19ms 22ms 26ms 129ms 457ms 6.8s
article (string inside object) 60ms 62ms 76ms 216ms 534ms 9.4s
article (string inside array) 72ms 77ms 102ms 207ms 1162ms 10.2s
recipe (name) 34ms 36ms 49ms 69ms 8ms 8.9s
recipe (description) 30ms 32ms 43ms 58ms 4ms 6.0s
recipe (instructions) 7ms 9ms 11ms 24ms 0ms 3.4s
synthetic (title) 72ms 75ms 79ms 282ms 1538ms 15.9s
synthetic (string inside object) 69ms 71ms 75ms 385ms 1106ms 9.7s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

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

Fantastic! Thank you so much for this @binoy14! 💖

@binoy14 binoy14 added this pull request to the merge queue Nov 4, 2024
Merged via the queue into next with commit 51db20a Nov 4, 2024
69 checks passed
@binoy14 binoy14 deleted the 11-01-test_cli_migrate_cli_tests_to_vitest branch November 4, 2024 16:28
bjoerge added a commit that referenced this pull request Nov 5, 2024
* next:
  chore(deps): dedupe pnpm-lock.yaml (#7752)
  chore(deps): update react monorepo (#7753)
  fix(deps): update dependency react-rx to ^4.1.3 (#7744)
  fix(deps): update dependency @sanity/ui to ^2.8.19 (#7742)
  fix(deps): update dependency @portabletext/editor to ^1.5.4 (#7737)
  fix(deps): update dependency @sanity/presentation to v1.17.8 (#7743)
  test(codegen): migrate codegen tests to vitest (#7741)
  fix: invalid locale namespace specified for create (#7732)
  chore(deps): update dependency @sanity/prettier-config to ^1.0.3 (#7733)
  fix(deps): update dependency react-rx to ^4.1.1 (#7739)
  fix(deps): update dependency groq-js to ^1.14.0 (#7738)
  test(cli): migrate cli tests to vitest (#7731)
  fix(core): export BetaFeatures and ScheduledPublishing types (#7659)
  chore(test-studio): update dependency @portabletext/editor to ^1.4.1 (#7734)
  fix(deps): update dependency @portabletext/editor to ^1.4.1 (#7735)
  fix(deps): update dependency @portabletext/editor to ^1.4.0 (#7729)
  fix(deps): update dependency @sanity/ui to ^2.8.18 (#7730)
  fix(deps): Update dev-non-major (#7724)
  fix(deps): update dependency @sanity/ui to ^2.8.17 (#7725)
  fix(deps): update dependency @portabletext/editor to ^1.3.0 (#7727)
bjoerge added a commit that referenced this pull request Nov 5, 2024
* next: (49 commits)
  v3.63.0
  chore(scripts): reordering blocks in release notes template script (#7758)
  chore(deps): update dependency babel-plugin-react-compiler to v19 (#7755)
  fix(deps): Update dev-non-major (#7736)
  chore(deps): dedupe pnpm-lock.yaml (#7752)
  chore(deps): update react monorepo (#7753)
  fix(deps): update dependency react-rx to ^4.1.3 (#7744)
  fix(deps): update dependency @sanity/ui to ^2.8.19 (#7742)
  fix(deps): update dependency @portabletext/editor to ^1.5.4 (#7737)
  fix(deps): update dependency @sanity/presentation to v1.17.8 (#7743)
  test(codegen): migrate codegen tests to vitest (#7741)
  fix: invalid locale namespace specified for create (#7732)
  chore(deps): update dependency @sanity/prettier-config to ^1.0.3 (#7733)
  fix(deps): update dependency react-rx to ^4.1.1 (#7739)
  fix(deps): update dependency groq-js to ^1.14.0 (#7738)
  test(cli): migrate cli tests to vitest (#7731)
  fix(core): export BetaFeatures and ScheduledPublishing types (#7659)
  chore(test-studio): update dependency @portabletext/editor to ^1.4.1 (#7734)
  fix(deps): update dependency @portabletext/editor to ^1.4.1 (#7735)
  fix(deps): update dependency @portabletext/editor to ^1.4.0 (#7729)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants