Skip to content

feat: support custom cache and email in TestRequestBuilder#582

Open
m4tx wants to merge 1 commit into
masterfrom
test-cache-email
Open

feat: support custom cache and email in TestRequestBuilder#582
m4tx wants to merge 1 commit into
masterfrom
test-cache-email

Conversation

@m4tx
Copy link
Copy Markdown
Member

@m4tx m4tx commented May 31, 2026

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

Copilot AI review requested due to automatic review settings May 31, 2026 14:23
@github-actions github-actions Bot added the C-lib Crate: cot (main library crate) label May 31, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Exposes public cache and email setters on TestRequestBuilder, so tests can supply custom cache and email backends instead of relying on the default in-memory cache and console email transport. The underlying fields and their consumption in build() already existed; this PR only adds the setter methods (gated behind the cache and email features).

Changes:

  • Add TestRequestBuilder::cache(Cache) setter under #[cfg(feature = "cache")].
  • Add TestRequestBuilder::email(Email) setter under #[cfg(feature = "email")].
  • Add doctest examples for both setters.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cot/src/test.rs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

🐰 Bencher Report

Branchtest-cache-email
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
7.09 ms
(+15.95%)Baseline: 6.11 ms
7.72 ms
(91.75%)
json_api/json_api📈 view plot
🚷 view threshold
1.16 ms
(+7.75%)Baseline: 1.08 ms
1.32 ms
(87.48%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
1.05 ms
(+6.15%)Baseline: 0.99 ms
1.20 ms
(87.54%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
1.01 ms
(+5.80%)Baseline: 0.96 ms
1.17 ms
(86.59%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
18.51 ms
(+4.68%)Baseline: 17.69 ms
21.15 ms
(87.54%)
🐰 View full continuous benchmarking report in Bencher

@m4tx m4tx force-pushed the test-cache-email branch from f791b95 to d3b25b8 Compare May 31, 2026 14:28
@m4tx m4tx requested review from ElijahAhianyo and seqre May 31, 2026 14:36
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/test.rs 0.00% 8 Missing ⚠️
Flag Coverage Δ
rust 90.26% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot/src/test.rs 84.77% <0.00%> (-1.30%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants