Skip to content

Skip reports coverage when no PHP tests are available #344

Description

@coisa

Problem

dev-tools reports always launches dev-tools tests as a mandatory sub-command. In repositories that do not have PHPUnit tests and may only contain docs/assets, reports execution can fail the CI path even when no test surface exists (observed in agents repo PR2).

Proposed Behavior

  • reports must not fail when test execution is not applicable.
  • For repositories without detectable tests, it should skip coverage report generation and continue generating the remaining report surfaces (docs/metrics).
  • The command must preserve a successful outcome when docs and metrics are produced and tests are skipped.
  • If tests exist but fail, reports should continue to fail as today.

Acceptance Criteria

  • reports behavior:
    • when no tests/ directory and no testable PHP source is detected, coverage/report test generation is skipped.
    • logs/structured output should clearly indicate that tests were skipped because no runnable test surface was detected.
  • dev-tools reports in a repository with no PHP tests should exit 0.
  • Existing behavior remains unchanged when tests are available.
  • Add/adjust unit tests for this branch:
    • skip tests queueing in ReportsCommand when no runnable tests are available.
    • keep queueing tests when tests are available.
  • Update changelog (Unreleased, Fixed) to describe the behavior.

Non-goals

  • Detecting partially misconfigured PHPUnit setups beyond existing test-runner behavior.
  • Changing tests command internals unless required by docs/report orchestration needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Merged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions