Skip to content

Redo OTLPMetricExporter unit tests of max_export_batch_size to use real export#5036

Merged
xrmx merged 4 commits intoopen-telemetry:mainfrom
tammy-baylis-swi:redo-http-metrics-batch-tests
Apr 3, 2026
Merged

Redo OTLPMetricExporter unit tests of max_export_batch_size to use real export#5036
xrmx merged 4 commits intoopen-telemetry:mainfrom
tammy-baylis-swi:redo-http-metrics-batch-tests

Conversation

@tammy-baylis-swi
Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi commented Apr 2, 2026

Description

Full redo of the HTTP OTLPMetricExporter unit tests of max_export_batch_size because they weren't using real export. It should be real OTLPMetricExporter.export now while Session.post is mocked at the HTTP level. The old tests also weren't the most readable, so I've factored out a helper to generate the metrics_data exported.

Fixes #5035

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Removed old tests
  • Replaced with new tests
  • tox -e py312-test-opentelemetry-exporter-otlp-proto-http

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review April 2, 2026 17:26
@tammy-baylis-swi tammy-baylis-swi requested a review from a team as a code owner April 2, 2026 17:26
@tammy-baylis-swi tammy-baylis-swi requested a review from xrmx April 2, 2026 17:27
@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in Python PR digest Apr 2, 2026
@xrmx xrmx enabled auto-merge (squash) April 3, 2026 12:45
@xrmx xrmx merged commit 0d26cb5 into open-telemetry:main Apr 3, 2026
507 of 508 checks passed
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Python PR digest Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix HTTP OTLPMetricExporter unit tests of max_export_batch_size to use real export

2 participants