Skip to content

opentelemetry-docker-tests: Refactor Docker tests to properly validate contents of exported telemetry#5220

Open
herin049 wants to merge 14 commits into
open-telemetry:mainfrom
herin049:misc/refactor-docker-tests
Open

opentelemetry-docker-tests: Refactor Docker tests to properly validate contents of exported telemetry#5220
herin049 wants to merge 14 commits into
open-telemetry:mainfrom
herin049:misc/refactor-docker-tests

Conversation

@herin049
Copy link
Copy Markdown
Contributor

Description

Prior to this refactor, the existing Docker exporter tests only verify that telemetry is correctly received by the OpenTelemetry collector. However, it does not validate that the contents of the telemetry received by the collector is semantically correct.

This refactor updates the Docker tests to properly validate the correctness of the contents of the telemetry received by the collector by updating the collector to forward all received telemetry to an additional OTLP HTTP server listening in the test runner process. The pytest tests are then able to examine the forwarded telemetry and verify the correctness of the contents of the telemetry, and that nothing was lost or mangled during exporting.

This PR also switches to using the system docker executable and likewise switches from using docker-compose to docker compose. Furthermore, it also adds functional tests for logging, which were previously not present.

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?

uv run tox -e docker-tests-otlpexporter

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

@herin049 herin049 requested a review from a team as a code owner May 18, 2026 03:15
Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

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

As a reminder for some reason the stuff we add to test-utils may also be used by downstream users

Comment thread tox.ini Outdated
Comment thread tox.ini Outdated
Comment thread tox.ini
Comment thread tox.ini
@herin049
Copy link
Copy Markdown
Contributor Author

As a reminder for some reason the stuff we add to test-utils may also be used by downstream users

@xrmx I figured we can maybe keep the server class public since some users might find it useful. Alternatively, I can make it private for now. Let me know what you think.

herin049 added 2 commits May 18, 2026 12:26
Removed PyYAML and requests dependencies from docker-tests environment.
@herin049 herin049 requested a review from xrmx May 19, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants