aiohttp-server: migrate test telemetry management to test_base #4121
+48
−111
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I am helping implement SDK metrics in open-telemetry/opentelemetry-python#4880. By nature of their definition, they are present by usage of the SDK itself, meaning the metrics are populated in instrumentation tests too. Unfortunately, many instrumentation tests have strict checks on generated metrics so extra metrics cause them to fail.
@xrmx suggested we can try adding filtering in
TestBase, and usingTestBasemore instead of doing management in unit tests simplifies them anyways, so I am helping with these migrations.This changes aiohttp-server pytest-based tests to use a test_base fixture to manage and fetch telemetry rather than doing the latter in the tests. This simplifies them while also allowing us to add more metrics + filtering in the core repo in a forwards-compatible way.
As it's testing infrastructure only, this PR should be
skip-changelog.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.