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(TestBackend): prevent area mismatch #1252

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

EdJoPaTo
Copy link
Contributor

@EdJoPaTo EdJoPaTo commented Jul 31, 2024

TestBackend::new(400, 400) resulted in a Rect with width/height 255,255 and a locally stored width/height of 400,400 which is wrong.

TestBackend::new could have been fixed, but this prevents this kind of error completely as its stored only at a single location now.

Hint for serde feature users: The TestBackend representation changes. It should be able to read older data, but data generated after this change can't be read by older versions.

`TestBackend::new(400, 400)` resulted in a Rect with width/height 255,255 and a locally stored width/height of 400,400 which is wrong.

`TestBackend::new` could have been fixed but this prevents this kind of error completely as its stored only at a single location now.
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.6%. Comparing base (b344f95) to head (cee31b5).

Files Patch % Lines
src/backend/test.rs 88.8% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1252     +/-   ##
=======================================
- Coverage   94.6%   94.6%   -0.1%     
=======================================
  Files         65      65             
  Lines      15407   15402      -5     
=======================================
- Hits       14576   14571      -5     
  Misses       831     831             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EdJoPaTo
Copy link
Contributor Author

Is this a breaking change? TestBackend implements serde derive. Reading from an older version should still work but reading from a newer version will not.

Copy link
Member

@joshka joshka left a comment

Choose a reason for hiding this comment

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

I'm fine with generally breaking forwards compatibility without noting it as a breaking change in the conventional commit / BREAKING-CHANGES doc. Just make sure the commit (PR comment) calls it out so it gets called out in the changelog.

Ping @a-kenji for their thoughts on this, as the reason TestBackend supports serde is for the reasons mentioned is for an external testing lib mentioned in #389. I'm assuming that it's probably ok though, and if kenji doesn't have time to weigh on this, then we can go ahead and merge this as-is.

Copy link

github-actions bot commented Aug 2, 2024

🐰Bencher

ReportFri, August 2, 2024 at 06:57:46 UTC
ProjectRatatui
Branch1252/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

  • Latency (latency)

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns)
barchart/render/2048➖ (view plot)177,310.00
barchart/render/256➖ (view plot)114,790.00
barchart/render/64➖ (view plot)72,157.00
barchart/render_grouped/2048➖ (view plot)324,180.00
barchart/render_grouped/256➖ (view plot)121,380.00
barchart/render_grouped/64➖ (view plot)110,120.00
barchart/render_horizontal/2048➖ (view plot)157,430.00
barchart/render_horizontal/256➖ (view plot)74,674.00
barchart/render_horizontal/64➖ (view plot)68,600.00
block/render_all_feature/100x50➖ (view plot)8,808.90
block/render_all_feature/200x50➖ (view plot)15,736.00
block/render_all_feature/256x256➖ (view plot)70,994.00
block/render_empty/100x50➖ (view plot)4,513.80
block/render_empty/200x50➖ (view plot)8,927.90
block/render_empty/256x256➖ (view plot)58,401.00
line_render/Center/0➖ (view plot)2.78
line_render/Center/10➖ (view plot)399.57
line_render/Center/3➖ (view plot)216.89
line_render/Center/4➖ (view plot)238.54
line_render/Center/42➖ (view plot)493.33
line_render/Center/6➖ (view plot)249.43
line_render/Center/7➖ (view plot)280.81
line_render/Left/0➖ (view plot)2.79
line_render/Left/10➖ (view plot)353.39
line_render/Left/3➖ (view plot)145.47
line_render/Left/4➖ (view plot)154.04
line_render/Left/42➖ (view plot)493.73
line_render/Left/6➖ (view plot)236.11
line_render/Left/7➖ (view plot)244.68
line_render/Right/0➖ (view plot)2.78
line_render/Right/10➖ (view plot)356.59
line_render/Right/3➖ (view plot)218.60
line_render/Right/4➖ (view plot)253.74
line_render/Right/42➖ (view plot)493.10
line_render/Right/6➖ (view plot)332.11
line_render/Right/7➖ (view plot)363.39
list/render/16384➖ (view plot)1,144,400.00
list/render/2048➖ (view plot)255,860.00
list/render/64➖ (view plot)132,420.00
list/render_scroll_half/16384➖ (view plot)1,149,400.00
list/render_scroll_half/2048➖ (view plot)257,380.00
list/render_scroll_half/64➖ (view plot)90,286.00
paragraph/new/2048➖ (view plot)249,480.00
paragraph/new/64➖ (view plot)6,233.00
paragraph/new/65535➖ (view plot)14,369,000.00
paragraph/render/2048➖ (view plot)446,170.00
paragraph/render/64➖ (view plot)406,620.00
paragraph/render/65535➖ (view plot)1,422,400.00
paragraph/render_scroll_full/2048➖ (view plot)404,330.00
paragraph/render_scroll_full/64➖ (view plot)422,590.00
paragraph/render_scroll_full/65535➖ (view plot)1,379,900.00
paragraph/render_scroll_half/2048➖ (view plot)406,130.00
paragraph/render_scroll_half/64➖ (view plot)432,790.00
paragraph/render_scroll_half/65535➖ (view plot)1,385,800.00
paragraph/render_wrap/2048➖ (view plot)225,660.00
paragraph/render_wrap/64➖ (view plot)186,630.00
paragraph/render_wrap/65535➖ (view plot)1,418,300.00
paragraph/render_wrap_scroll_full/2048➖ (view plot)227,730.00
paragraph/render_wrap_scroll_full/64➖ (view plot)190,090.00
paragraph/render_wrap_scroll_full/65535➖ (view plot)1,419,100.00
sparkline/render/2048➖ (view plot)110,920.00
sparkline/render/256➖ (view plot)110,990.00
sparkline/render/64➖ (view plot)35,423.00

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

EdJoPaTo added a commit to EdJoPaTo/ratatui that referenced this pull request Aug 2, 2024
@joshka joshka merged commit 864cd9f into ratatui:main Aug 5, 2024
36 of 37 checks passed
@EdJoPaTo EdJoPaTo deleted the test-backend-area-mismatch branch August 5, 2024 07:00
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