Skip to content

asgi: use test_base helpers where possible and otherwise filter scope#4122

Merged
xrmx merged 4 commits intoopen-telemetry:mainfrom
anuraaga:asgi-test-base
Feb 4, 2026
Merged

asgi: use test_base helpers where possible and otherwise filter scope#4122
xrmx merged 4 commits intoopen-telemetry:mainfrom
anuraaga:asgi-test-base

Conversation

@anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Jan 23, 2026

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 using TestBase more instead of doing management in unit tests simplifies them anyways, so I am helping with these migrations. Some locations do manual filtering locally where still needed until having access to a new helper in TestBase.

As it's testing infrastructure only, this PR should be skip-changelog.

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?

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

  • Unit tests

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 23, 2026
@xrmx xrmx enabled auto-merge (squash) February 4, 2026 16:25
@xrmx xrmx merged commit 24c7bbb into open-telemetry:main Feb 4, 2026
663 checks passed
wikaaaaa pushed a commit to wikaaaaa/opentelemetry-python-contrib that referenced this pull request Feb 5, 2026
…open-telemetry#4122)

* asgi: use test_base helpers where possible and otherwise filter scope

* Pass scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants