Skip to content

Increase Tracer package unit-test coverage to >=90% #483

Description

@armanist

Summary

Increase unit-test coverage for the Tracer package from the current ~10% to at least 90% line coverage.

Scope

Target package:

  • src/Tracer/**

Related tests:

  • tests/Unit/Tracer/**

Goals

  1. Raise line coverage for src/Tracer/** to >=90%.
  2. Cover core behavior and error paths, not just superficial execution.
  3. Keep tests stable across local and CI environments.

Required coverage areas

  • tracer initialization/configuration flows
  • span/trace lifecycle behavior
  • context propagation and mutation paths
  • exporter/adapter integration boundaries (mocked where appropriate)
  • failure/exception paths and guard clauses

Test quality requirements

  • Assert observable behavior and outputs.
  • Avoid coverage-only tests with no contract validation.
  • Include both success and failure scenarios.
  • Minimize brittle internals-based assertions.

Acceptance criteria

  • Coverage report shows >=90% line coverage for src/Tracer/**.
  • Tests pass locally and in CI.
  • Validation passes:
    • vendor/bin/phpunit --coverage-clover coverage.xml
    • composer phpstan
    • composer cs:check

Notes

  • If any file cannot reasonably hit 90%, document justification and proposed threshold in PR.

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions