-
Notifications
You must be signed in to change notification settings - Fork 453
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
chore: Test sync exporters #2455
chore: Test sync exporters #2455
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2455 +/- ##
=======================================
- Coverage 76.1% 76.1% -0.1%
=======================================
Files 122 122
Lines 22065 22066 +1
=======================================
Hits 16793 16793
- Misses 5272 5273 +1 ☔ View full report in Codecov by Sentry. |
@@ -22,7 +22,7 @@ fn init_tracer() -> sdktrace::TracerProvider { | |||
|
|||
struct MetadataMap<'a>(&'a mut tonic::metadata::MetadataMap); | |||
|
|||
impl<'a> Injector for MetadataMap<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied clippy fixes and it wants to elide this lifecycle 🤷
@@ -29,7 +29,7 @@ pub mod hello_world { | |||
|
|||
struct MetadataMap<'a>(&'a tonic::metadata::MetadataMap); | |||
|
|||
impl<'a> Extractor for MetadataMap<'a> { | |||
impl Extractor for MetadataMap<'_> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and this one
@@ -239,7 +239,7 @@ mod any_value { | |||
pub(crate) fn serialize(value: log::kv::Value) -> Option<AnyValue> { | |||
struct ValueVisitor(Option<AnyValue>); | |||
|
|||
impl<'kvs> log::kv::VisitValue<'kvs> for ValueVisitor { | |||
impl log::kv::VisitValue<'_> for ValueVisitor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and this one.
I can remove these, but we should probably start enforcing this in CI anyway, I reckon :D
@@ -84,15 +98,44 @@ mod logtests { | |||
|
|||
Ok(()) | |||
} | |||
|
|||
#[test] | |||
#[cfg(any(feature = "tonic-client", feature = "reqwest-blocking-client"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cijothomas here's the new test. I took advantage of the temporary tokio runtime to setup the collector too.
@@ -140,8 +140,8 @@ struct UnsafeSlice<'a> { | |||
slice: &'a [UnsafeCell<WorkerStats>], | |||
} | |||
|
|||
unsafe impl<'a> Send for UnsafeSlice<'a> {} | |||
unsafe impl<'a> Sync for UnsafeSlice<'a> {} | |||
unsafe impl Send for UnsafeSlice<'_> {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More elision
@cijothomas , works on my machine ;) Needs the |
let logger_provider = rt.block_on(async { | ||
// While we're here setup our collector container too, as this needs tokio to run | ||
test_utils::start_collector_container().await?; | ||
init_logs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - will it make sense to have two different tests, with init_logs
being called within tokio runtime only for tonic-client
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
More work for #2432. In this case we're adding coverage for using the batch log exporters from non-tokio main functions.
Changes
Please provide a brief description of the changes here.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial, user-facing changes