Skip to content

test: refactor body cache tests#1359

Open
mavonx wants to merge 5 commits into
floatpane:masterfrom
mavonx:fix/issue-887
Open

test: refactor body cache tests#1359
mavonx wants to merge 5 commits into
floatpane:masterfrom
mavonx:fix/issue-887

Conversation

@mavonx
Copy link
Copy Markdown
Contributor

@mavonx mavonx commented May 24, 2026

What?

Refactors the test suite for email body cache.

Why?

The previous implementation only covered a few narrow scenarios and failed to test the system under most practical edge cases.

Closes #887

@mavonx mavonx requested a review from a team as a code owner May 24, 2026 21:19
@floatpanebot floatpanebot added area/config Configuration / settings chore Maintenance, refactor, cleanup size/L Diff: 201–800 lines labels May 24, 2026
@floatpanebot
Copy link
Copy Markdown
Member

floatpanebot commented May 24, 2026

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor                
                           │    old.txt    │               new.txt               │
                           │    sec/op     │    sec/op      vs base              │
ParseSearchQuery_Simple-4     2.991µ ± 34%   2.993µ ± 138%       ~ (p=0.937 n=6)
ParseSearchQuery_Complex-4   11.104µ ± 51%   8.139µ ±  35%       ~ (p=0.132 n=6)
TokenizeSearchQuery-4         4.615µ ± 40%   5.298µ ±  17%       ~ (p=0.065 n=6)
geomean                       5.351µ         5.053µ         -5.57%

                           │  old.txt   │               new.txt               │
                           │    B/op    │    B/op      vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 23%       ~ (p=1.000 n=6)
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ±  0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ±  0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6        +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │   old.txt    │               new.txt               │
                    │    sec/op    │    sec/op     vs base               │
LogPanelView-4        171.5µ ±  7%   173.5µ ± 13%        ~ (p=0.937 n=6)
SearchOverlayView-4   179.6µ ± 29%   203.9µ ± 15%        ~ (p=0.310 n=6)
InboxConstruction-4   890.6µ ± 11%   677.1µ ± 22%  -23.97% (p=0.015 n=6)
geomean               301.6µ         288.3µ         -4.42%

                    │    old.txt    │               new.txt               │
                    │     B/op      │     B/op       vs base              │
LogPanelView-4        44.67Ki ± 51%   33.23Ki ± 34%       ~ (p=0.545 n=6)
SearchOverlayView-4   56.14Ki ± 41%   56.14Ki ±  0%       ~ (p=0.530 n=6)
InboxConstruction-4   874.0Ki ±  0%   873.9Ki ±  0%       ~ (p=0.647 n=6)
geomean               129.9Ki         117.7Ki        -9.40%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         714.0 ± 0%    713.0 ± 0%       ~ (p=0.545 n=6)
SearchOverlayView-4    926.0 ± 0%    926.0 ± 0%       ~ (p=0.545 n=6)
InboxConstruction-4   3.476k ± 0%   3.476k ± 0%       ~ (p=0.727 n=6)
geomean               1.320k        1.319k       -0.05%

auto-generated by benchmarks.yml

@floatpanebot floatpanebot added the area/build Build system / Makefile / packaging label May 25, 2026
@andrinoff
Copy link
Copy Markdown
Member

@mavonx, please, drop 26c1f9a and c41b451 (git rebase -i HEAD~3 and place d (drop) instead of pick on these commits) don't forget to pull the branch

@andrinoff andrinoff removed the area/build Build system / Makefile / packaging label May 25, 2026
@mavonx
Copy link
Copy Markdown
Contributor Author

mavonx commented May 25, 2026

@andrinoff

I’m going to do a small refactor and add a few more tests as well, so I’d prefer to hold the review for now.

I’ll mention you once it’s ready for review.

@andrinoff andrinoff marked this pull request as draft May 25, 2026 15:52
@andrinoff
Copy link
Copy Markdown
Member

converting to draft will hold off reviews

@mavonx
Copy link
Copy Markdown
Contributor Author

mavonx commented May 25, 2026

@andrinoff

Ready for review.

@andrinoff andrinoff marked this pull request as ready for review May 25, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Configuration / settings chore Maintenance, refactor, cleanup size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add unit tests for config/cache.go

3 participants