Skip to content

refactor: parametrize tests#3256

Merged
cijothomas merged 2 commits into
open-telemetry:mainfrom
chickenbreeder:fix-1552
May 27, 2026
Merged

refactor: parametrize tests#3256
cijothomas merged 2 commits into
open-telemetry:mainfrom
chickenbreeder:fix-1552

Conversation

@chickenbreeder

Copy link
Copy Markdown
Contributor

Fixes #1552

Changes

#[rstest]
#[tokio::test]

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@chickenbreeder chickenbreeder requested a review from a team as a code owner November 22, 2025 11:38
@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 22, 2025

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: chickenbreeder / name: chickenbreeder (a1e2f3a)

@codecov

codecov Bot commented Nov 22, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.9%. Comparing base (6e1fbbe) to head (9808699).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #3256     +/-   ##
=======================================
- Coverage   82.9%   82.9%   -0.1%     
=======================================
  Files        130     130             
  Lines      27386   27350     -36     
=======================================
- Hits       22711   22675     -36     
  Misses      4675    4675             

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scottgerring

Copy link
Copy Markdown
Member

I asked Claude to see if there are many others here we could pick up. Not sure how useful this is, but it's probably worth trying to pick out other instances of this pattern we can clean up!

  1. opentelemetry-zipkin/src/propagator/mod.rs:464-683
    • B3 propagator tests with extensive test data sets
    • Multiple nested loops for single/multi-header formats
    • Could consolidate 20+ test cases
  2. opentelemetry-sdk/src/metrics/internal/exponential_histogram.rs
    - Multiple locations (555-664, 914-1072, 1141-1229)
    - Complex test data structures for bucket calculations
    - 30+ test cases across different test functions
  3. opentelemetry-otlp/src/retry.rs:218-495
    - 10+ similar async test functions for retry logic
    - Each tests different scenarios (success, failure, timeout, throttling)
    - Perfect candidate for #[rstest] with #[case] attributes

@scottgerring scottgerring self-assigned this Nov 22, 2025
@scottgerring

Copy link
Copy Markdown
Member

@chickenbreeder let me know when you are ready with this!

@scottgerring scottgerring marked this pull request as draft November 22, 2025 15:30
@scottgerring

Copy link
Copy Markdown
Member

Hey @chickenbreeder , did you want to do more of these, or should we review it as it is?

@chickenbreeder

Copy link
Copy Markdown
Contributor Author

Hey @scottgerring. Sorry, I did not get around to do any further work on this.

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

Thank you for your contribution! This PR has been automatically marked as stale because it has not had activity in the last 14 days. This may be due to a delay in review on our side or awaiting a response from you; either is fine, and we appreciate your patience.

It will be closed in 14 days if no further activity occurs. Pushing a new commit or leaving a comment will remove the stale label and keep the PR open.

@github-actions github-actions Bot added the Stale label May 9, 2026
@github-actions

Copy link
Copy Markdown

Closed as inactive. Thank you again for the contribution; please feel free to reopen this PR (or open a new one) if you'd like to continue the work.

@github-actions github-actions Bot closed this May 23, 2026
@scottgerring scottgerring reopened this May 26, 2026
@scottgerring

Copy link
Copy Markdown
Member

As we worked on this together at a hackathon earlier this year, it would be cool to see this merged. I'll try rebase against main this week.

@scottgerring scottgerring marked this pull request as ready for review May 27, 2026 10:58

@scottgerring scottgerring left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @chickenbreeder ! This gets us started with parameterized tests; it doesn't cover everything ofc, but we should merge it.

Pinging @cijothomas to get on the queue

@cijothomas cijothomas added this pull request to the merge queue May 27, 2026
Merged via the queue into open-telemetry:main with commit f7b0dd9 May 27, 2026
28 checks passed
jsurany pushed a commit to jsurany/opentelemetry-rust that referenced this pull request Jun 2, 2026
Co-authored-by: Scott Gerring <scottgerring@users.noreply.github.com>
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.

Use parameterization to simplify tests

3 participants