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

chore(otlp-exporter-*-proto): clean up tests #5199

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

All the functionality that's duplicate-tested in all the HTTP/protobuf exporters is now tested in the exporter base packages as well as in @opentelemetry/otlp-transformer for serialization. This PR is similar to #5196 and #5198, but for the HTTP protobuf exporters.

This PR removes the tests from the individual exporters and replaces them with a simple check that tests if

  • http/xhr/sendBeacon is indeed used
  • the export succeeds

The previous implementation was heavily relying on constructing export data and asserting the data that is sent, which makes changes to the SDK's internal structure very difficult. This testing is now all handled in @opentelemetry/otlp-transformer so there should be no need to test this again in every individual exporter.

I also added a comment for future contributors that this tests file is not where they should add any tests that concern base components.

Partially enables #4583 (types exported from @opentelemetry/otlp-transformer are used in testing, by removing test usages, we can remove types that were only used in tests from the public API)

Type of change

  • Internal test update

How Has This Been Tested?

  • Changed tests

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.58%. Comparing base (e250a0f) to head (6bc9a0e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5199      +/-   ##
==========================================
- Coverage   94.59%   94.58%   -0.02%     
==========================================
  Files         314      314              
  Lines        7993     7993              
  Branches     1611     1611              
==========================================
- Hits         7561     7560       -1     
- Misses        432      433       +1     

see 1 file with indirect coverage changes

@pichlermarc pichlermarc marked this pull request as ready for review November 25, 2024 17:24
@pichlermarc pichlermarc requested a review from a team as a code owner November 25, 2024 17:24
@pichlermarc pichlermarc added this to the OTLP Exporter GA milestone Nov 25, 2024
experimental/CHANGELOG.md Outdated Show resolved Hide resolved
@pichlermarc pichlermarc added this pull request to the merge queue Nov 26, 2024
Merged via the queue into open-telemetry:main with commit 556eecf Nov 26, 2024
21 checks passed
@pichlermarc pichlermarc deleted the chore/clean-up-protobuf-tests branch November 26, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants