Skip to content

Add test coverage - #27

Merged
Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/testcoverage
Apr 10, 2026
Merged

Hector Hernandez (hectorhdzg) merged 2 commits into
microsoft:mainfrom
hectorhdzg:hectorhdzg/testcoverage

Conversation

@hectorhdzg

Copy link
Copy Markdown
Member

Increased coverage from 77% to %92

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on increasing automated test coverage for the Microsoft OpenTelemetry distro, and wiring coverage reporting into the test tooling.

Changes:

  • Enable pytest coverage collection via pytest-cov and coverage.py configuration.
  • Add new unit tests for instrumentation dependency-conflict detection and Azure Monitor browser SDK loader behavior.
  • Extend existing tests and adjust Django middleware initialization to support environments without Django.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tox.ini Adds pytest --cov invocation so tox runs generate coverage output.
pyproject.toml Adds pytest-cov to optional deps and configures coverage source/reporting.
dev_requirements.txt Adds pytest-cov to dev test dependencies used by tox.
tests/test_instrumentation.py New unit tests for core _instrumentation dependency conflict helpers.
tests/test_distro.py Adds tests for _setup_logging() behavior.
tests/conftest.py Removes collection ignore configuration (file becomes effectively empty).
tests/azure_monitor/utils/test_instrumentation.py New unit tests for Azure Monitor instrumentation conflict helpers.
tests/azure_monitor/test_configure.py Updates tests to align with refactors around instrumentation setup and browser SDK loader setup.
tests/azure_monitor/browserSdkLoader/test_snippet_injector.py Adds broader test coverage for snippet injection, compression handling, and statsbeat marking.
tests/azure_monitor/browserSdkLoader/test_init.py New tests for browser SDK loader Django integration setup utilities.
src/microsoft/opentelemetry/_azure_monitor/_browser_sdk_loader/django_middleware.py Guards super().__init__ call when Django isn’t installed (stub mixin).
.coverage Adds a generated coverage DB artifact to the repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_instrumentation.py Outdated
Comment thread tests/azure_monitor/utils/test_instrumentation.py Outdated
Comment thread tests/azure_monitor/browserSdkLoader/test_init.py Outdated
Comment thread tests/test_distro.py
Comment thread tests/test_distro.py
Comment thread tests/conftest.py Outdated
Comment thread tests/azure_monitor/test_configure.py
Comment thread tests/azure_monitor/test_configure.py
Comment thread tests/azure_monitor/test_configure.py
Comment thread pyproject.toml
@hectorhdzg
Hector Hernandez (hectorhdzg) merged commit f6b57c0 into microsoft:main Apr 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants