Skip to content

Branch coverage is not measurable and method coverage is below 80% #43

@nficano

Description

@nficano

Running XDEBUG_MODE=coverage composer coverage on PHP 8.4.21 with PCOV 1.0.12 passes the PHPUnit suite with 329 tests and 749 assertions, and line coverage is 87.72%. However, branch coverage is not reported with the installed PCOV driver, while class coverage is 52.84% and method coverage is 73.64%. Clover also shows under-covered files that sit below 80% line coverage, including src/Internal/Runtime/CredentialLifecycle.php, src/Transport/StdioTransport.php, src/Internal/Runtime/ArtifactDispatcher.php, src/Internal/Runtime/JobListHandler.php, src/Client/ResultChunkAssembler.php, src/Internal/Client/ResponseRouter.php, src/Auth/JwtAuth.php, and src/Runtime/JobCredentialControls.php.

The current coverage signal therefore confirms the line threshold but does not answer the requested branch threshold, and several critical protocol paths still have untested branches around credential issuance, stdio framing, artifact errors, list job filters, result chunk integrity, response routing, JWT claims, and credential rotation.

Fix prompt: Add an Xdebug-backed coverage job or local script that reports branch coverage, then set an explicit branch target. Add focused PHPUnit coverage for the listed under-covered classes, favoring data providers for filter and validation matrices and property-style tests where invariants are important, such as result chunk sequence contiguity and cost budget conservation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    severity:mediumMedium severitytestingTest coverage and test infrastructure

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions