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

replace usages of TestSpanExporter with InMemorySpanExporter #1626

Merged
merged 5 commits into from
Mar 17, 2024

Conversation

sreeo
Copy link
Contributor

@sreeo sreeo commented Mar 17, 2024

Fixes #
Replaces usages of TestSpanExporter with InMemorySpanExporter

Changes

Please provide a brief description of the changes here.

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)

@sreeo sreeo requested a review from a team March 17, 2024 11:30
Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.0%. Comparing base (bae8fb3) to head (da8fa04).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1626     +/-   ##
=======================================
- Coverage   69.0%   69.0%   -0.1%     
=======================================
  Files        139     139             
  Lines      19846   19833     -13     
=======================================
- Hits       13703   13693     -10     
+ Misses      6143    6140      -3     

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

let _result = processor.shutdown();
assert!(exporter.is_shutdown_called());
assert!(exporter.get_finished_spans().unwrap().is_empty());
Copy link
Member

Choose a reason for hiding this comment

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

nit: Add a comment saying, we indirectly test shutdown is called, by asserting that spans are empty in inmemoryexporter.

assert!(!exporter.is_shutdown_called());
let span_data = new_test_export_span_data();
processor.on_end(span_data.clone());
assert_eq!(exporter.get_finished_spans().unwrap()[0], span_data);
Copy link
Member

Choose a reason for hiding this comment

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

nit: we only need to validate that finished spans is not empty before shutdown, and is empty after shutdown, to keep the test very focused on its purpose.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Looks good.
Left couple of comments, to be addressed before merge, esp. removing the changelog entry

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

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

fix #1616

@TommyCpp
Copy link
Contributor

looks good. Thanks!

@TommyCpp TommyCpp merged commit a7a47a7 into open-telemetry:main Mar 17, 2024
17 checks passed
@sreeo sreeo deleted the memoryexporter branch March 18, 2024 02:50
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