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: add test for typemap #8698

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Conversation

sgulseth
Copy link
Member

Description

Ensures that the generated query typemap matches the expected generated types and query.

What to review

Testing

Well, added

Notes for release

N/A

@sgulseth sgulseth requested a review from stipsan February 18, 2025 22:51
@sgulseth sgulseth requested a review from a team as a code owner February 18, 2025 22:51
@sgulseth sgulseth requested review from rexxars and removed request for a team February 18, 2025 22:51
Copy link

vercel bot commented Feb 18, 2025

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 Feb 18, 2025 10:56pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 10:56pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 10:56pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Feb 18, 2025 10:56pm
test-next-studio ⬜️ Ignored (Inspect) Feb 18, 2025 10:56pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.94% 54791 / 127596
🔵 Statements 42.94% 54791 / 127596
🔵 Functions 48.09% 2788 / 5797
🔵 Branches 79.43% 10599 / 13343
File CoverageNo changed files found.
Generated in workflow #30678 for commit 31f0af4 by the Vitest Coverage Report Action

Copy link
Contributor

⚡️ Editor Performance Report

Updated Tue, 18 Feb 2025 23:04:46 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.8 efps (36ms) 26.3 efps (38ms) +2ms (+5.6%)
article (body) 72.2 efps (14ms) 75.2 efps (13ms) -1ms (-/-%)
article (string inside object) 29.4 efps (34ms) 26.7 efps (38ms) +4ms (+10.3%)
article (string inside array) 25.0 efps (40ms) 23.3 efps (43ms) +3ms (+7.5%)
recipe (name) 50.0 efps (20ms) 50.0 efps (20ms) +0ms (-/-%)
recipe (description) 55.6 efps (18ms) 55.6 efps (18ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 18.5 efps (54ms) 18.2 efps (55ms) +1ms (+1.9%)
synthetic (string inside object) 18.3 efps (55ms) 19.2 efps (52ms) -3ms (-4.6%)

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) 36ms 40ms 55ms 295ms 550ms 9.7s
article (body) 14ms 17ms 35ms 172ms 198ms 5.4s
article (string inside object) 34ms 37ms 43ms 248ms 264ms 6.6s
article (string inside array) 40ms 42ms 45ms 154ms 253ms 6.9s
recipe (name) 20ms 22ms 25ms 41ms 6ms 7.1s
recipe (description) 18ms 21ms 23ms 31ms 0ms 4.6s
recipe (instructions) 5ms 7ms 8ms 9ms 0ms 3.1s
synthetic (title) 54ms 60ms 68ms 447ms 1436ms 14.3s
synthetic (string inside object) 55ms 61ms 74ms 572ms 1408ms 9.5s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 38ms 41ms 54ms 444ms 691ms 11.0s
article (body) 13ms 14ms 21ms 40ms 69ms 4.9s
article (string inside object) 38ms 39ms 46ms 172ms 252ms 7.0s
article (string inside array) 43ms 44ms 51ms 292ms 416ms 7.4s
recipe (name) 20ms 22ms 25ms 54ms 0ms 7.2s
recipe (description) 18ms 19ms 20ms 34ms 0ms 4.5s
recipe (instructions) 5ms 7ms 8ms 19ms 0ms 3.1s
synthetic (title) 55ms 59ms 64ms 296ms 1227ms 13.9s
synthetic (string inside object) 52ms 55ms 77ms 366ms 1224ms 8.9s

📚 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
Contributor

Component Testing Report Updated Feb 18, 2025 11:08 PM (UTC)

❌ Failed Tests (4) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 18s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 2m 43s 3 0 3
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 1m 1s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 30s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 17s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 17s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 56s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ❌ Failed (Inspect) 3m 0s 20 0 1
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 15s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 2m 1s 21 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

@@ -70,6 +70,26 @@ describeCliTest('CLI: `sanity typegen`', () => {
expect(types.toString()).toMatchSnapshot()
})

test('sanity typegen generate: generates query type map', async () => {
// Write a prettier config to the output folder, with single quotes. The defeault is double quotes.
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I understand this comment? We're not writing any prettier configs here, are we?

Copy link
Member

@stipsan stipsan left a comment

Choose a reason for hiding this comment

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

Other than what @rexxars already called out it LGTM

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.

3 participants