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

Move autoconfigure otlp tests #5060

Merged

Conversation

jack-berg
Copy link
Member

Resolves #4949.

This is likely an unreviewable change. Here's a summary of it and why its hard to break up:

  • Ultimate goal is to move OTLP tests out of :sdk-extensions:autoconfigure and into :exporter:otlp.
  • Unfortunately the OTLP tests in :sdk-extensions:autoconfigure provide a decent amount of coverage for the OtlpHttp{Signal}Exporters that doesn't otherwise exist. The OtlpGrpc{Signal}Exporters don't have this same problem because they have an abstract test class with a bunch of implementations.
  • I've made up for this coverage deficiency by adding AbstractHttpTelemetryExporterTest and corresponding implementations. Its largely a copy of AbstractGrpcTelemetryExporterTest with changes as needed to reflect differences in grpc and http/protobuf.
  • This allows the the OTLP tests to be deleted in there current form, since coverage exists elsewhere.
  • However, new tests were needed to check that the SPI implementations interpret ConfigProperties and configure the builders correctly. The new Otlp{Signal}ExporterProviderTests provide this coverage. I thought about abstracting the common parts away, but concluded it would make the test code too hard to comprehend.

This could be reasonably broken up into two PRs, but even those would be pretty large and hard to review carefully.

@jack-berg jack-berg requested a review from a team as a code owner December 21, 2022 22:51
@codecov
Copy link

codecov bot commented Dec 21, 2022

Codecov Report

Base: 91.19% // Head: 91.06% // Decreases project coverage by -0.13% ⚠️

Coverage data is based on head (51c5b2f) compared to base (9dfb002).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5060      +/-   ##
============================================
- Coverage     91.19%   91.06%   -0.14%     
- Complexity     4877     4887      +10     
============================================
  Files           553      553              
  Lines         14402    14460      +58     
  Branches       1375     1380       +5     
============================================
+ Hits          13134    13168      +34     
- Misses          879      898      +19     
- Partials        389      394       +5     
Impacted Files Coverage Δ
...rter/otlp/internal/OtlpMetricExporterProvider.java 100.00% <100.00%> (ø)
...porter/otlp/internal/OtlpSpanExporterProvider.java 100.00% <100.00%> (ø)
...r/otlp/internal/OtlpLogRecordExporterProvider.java 100.00% <100.00%> (ø)
...etry/exporter/internal/okhttp/JsonRequestBody.java 0.00% <0.00%> (-100.00%) ⬇️
...emetry/exporter/internal/grpc/GrpcRequestBody.java 56.52% <0.00%> (-43.48%) ⬇️
...rter/otlp/http/metrics/OtlpHttpMetricExporter.java 84.61% <0.00%> (-7.70%) ⬇️
...metry/exporter/internal/okhttp/OkHttpExporter.java 89.39% <0.00%> (-6.07%) ⬇️
...lp/http/metrics/OtlpHttpMetricExporterBuilder.java 95.00% <0.00%> (-5.00%) ⬇️
...lemetry/exporter/internal/otlp/OtlpConfigUtil.java 89.68% <0.00%> (-2.39%) ⬇️
...etry/exporter/internal/otlp/logs/LogMarshaler.java 67.10% <0.00%> (-1.32%) ⬇️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jkwatson
Copy link
Contributor

hmm. This all looks good, but it looks like it reduced coverage a bit. Any idea how difficult it would be to backfill those gaps?

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

Not happy with the slightly reduced coverage numbers, but otherwise looks fine to me.

@jack-berg
Copy link
Member Author

I've added some tests to increase the coverage. The coverage should be equivalent now. I think any remaining diff is just one of those quirks with the codecov tool.

@jack-berg jack-berg merged commit 2834b03 into open-telemetry:main Dec 29, 2022
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.

Refactor autoconfigure to implement exporter provider SPIs
2 participants