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(exporter-otlp-*-http): clean up tests #5198

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

All the functionality that's duplicate-tested in all the HTTP/json exporters is now tested in the exporter base packages as well as in @opentelemetry/otlp-transformer for serialization. This PR is similar to #5196, but for the HTTP 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 (556eecf) to head (eebcf22).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5198   +/-   ##
=======================================
  Coverage   94.58%   94.58%           
=======================================
  Files         314      314           
  Lines        7993     7993           
  Branches     1611     1611           
=======================================
  Hits         7560     7560           
  Misses        433      433           

@pichlermarc pichlermarc added this pull request to the merge queue Nov 26, 2024
Merged via the queue into open-telemetry:main with commit e35f3d6 Nov 26, 2024
21 checks passed
@pichlermarc pichlermarc deleted the chore/cleanup-http-json-exporter-tests branch November 26, 2024 09:20
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