Skip to content

Coverage is not collected for incomplete/skipped tests #922

@mvorisek

Description

@mvorisek
Q A
php-code-coverage version 9.2.15
PHP version 8.0.20
Driver Xdebug
Xdebug version 3.1.5
Installation Method Composer
Usage Method PHPUnit
PHPUnit version (if used) 9.5.21

We collect coverage for tests too to detect dead code.

For some reasons, $this->markTestIncomplete() line [1] (and other throwing calls like $this->fail()) are excluded from the coverage, althrough the lines are reached.

I would expect the coverage to be collected for these lines. (and no line after, but that works correctly)

It seems the coverage collection is stopped too early, ie. before the coverage for the throwing call is stored.

[1] example https://app.codecov.io/gh/atk4/data/compare/1017/tree/tests/Util/DeepCopyTest.php#D1L251

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions