Skip to content

Add PHPUnit progress and coverage summary options #84

@coisa

Description

@coisa

Problem

The tests command should let maintainers control PHPUnit progress output and text coverage verbosity without manually passing low-level PHPUnit flags. This matters in CI and report generation, where progress output can be noisy and full coverage text can make logs hard to scan.

Proposal

Add first-class DevTools options that map to PHPUnit flags:

  • --no-progress disables PHPUnit progress output by forwarding --no-progress.
  • --coverage-summary requests concise text coverage output by forwarding --only-summary-for-coverage-text when text coverage is generated.

The reports command should also use both options when invoking tests so generated reports stay quiet and coverage text remains concise.

Goals

  • Expose --no-progress on the tests command and forward it to PHPUnit only when requested.
  • Expose a short, coverage-specific option named --coverage-summary on the tests command.
  • Forward --only-summary-for-coverage-text only when coverage text is being generated.
  • Update reports so its delegated tests command includes --no-progress and --coverage-summary.
  • Keep existing coverage, min-coverage, and report generation behavior compatible.

Expected Behavior

A maintainer can run vendor/bin/dev-tools tests --no-progress to suppress PHPUnit progress output. A maintainer can run vendor/bin/dev-tools tests --coverage=public/coverage --coverage-summary to keep coverage text output to the summary. The reports command should call the tests command with both quiet progress and concise coverage text behavior by default.

Implementation Strategy

Continue the existing command implementation by wiring the new options through TestsCommand process argument construction and updating ReportsCommand delegation arguments. Add focused command tests for option definition and forwarding behavior.

Requirements

  • tests --no-progress MUST pass --no-progress to PHPUnit.
  • tests --coverage=<path> --coverage-summary MUST pass --only-summary-for-coverage-text to PHPUnit.
  • tests --coverage-summary without coverage SHOULD NOT add coverage-text summary arguments unless coverage text is generated for another supported reason.
  • reports MUST invoke tests with --no-progress and --coverage-summary together with its configured coverage path.
  • Existing --coverage and --min-coverage behavior MUST continue to work.
  • Tests MUST cover the new command options and report delegation.

Non-goals

  • Changing PHPUnit default output when neither option is provided.
  • Renaming existing coverage options.
  • Changing coverage threshold calculation.
  • Reworking the process builder abstraction.

Benefits

This improves CI log readability, keeps report generation quieter, and gives maintainers stable DevTools-level flags instead of requiring direct PHPUnit option knowledge.

Acceptance Criteria

Functional Criteria

  • tests defines --no-progress and forwards --no-progress to PHPUnit when passed.
  • tests defines --coverage-summary and forwards --only-summary-for-coverage-text when coverage text is generated.
  • tests does not forward coverage summary output flags when no coverage text is generated.
  • reports delegates to tests with --no-progress and --coverage-summary.
  • Existing coverage and min-coverage tests still pass.

Architectural / Isolation Criteria

  • TestsCommand remains responsible for translating DevTools CLI options into PHPUnit arguments.
  • ReportsCommand remains orchestration-focused and does not duplicate PHPUnit argument construction.
  • Tests assert command intent through process arguments rather than depending on incidental command string formatting.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions