Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Nov 8, 2025

In #4527 we found out that #[CoversNothing] can speedup the coverage generation process.

We can only add this attributes to tests which are not relevant for mutation testing, because infection would not see these tests when they are no longer part of the coverage report.


tbh: I cannot believe the results running
(its reproducible though)

XDEBUG_MODE=coverage php tests/vendor/bin/paratest \
          --coverage-xml=tmp/coverage/coverage-xml \
          --log-junit=tmp/coverage/junit.xml

ParaTest v7.8.4 upon PHPUnit 11.5.43 by Sebastian Bergmann and contributors.

Warming cache for static analysis ... [00:00.051]
Processes:     14
Runtime:       PHP 8.3.27 with Xdebug 3.4.7
Configuration: /Users/staabm/workspace/phpstan-src/phpunit.xml
Random Seed:   1762589403

...................SS.....................S...S...........S    59 / 13334 (  0%)
...........................................................   118 / 13334 (  0%)
..

before this PR:

Time: 07:57.258, Memory: 618.50 MB

OK, but some tests were skipped!
Tests: 13334, Assertions: 80601, Skipped: 171.

Generating code coverage report in PHPUnit XML format ... done [00:34.829]

after this PR:

Time: 03:44.550, Memory: 660.50 MB

OK, but some tests were skipped!
Tests: 13334, Assertions: 80601, Skipped: 171.

Generating code coverage report in PHPUnit XML format ... done [00:32.989]

on macbook m4 pro

@staabm
Copy link
Contributor Author

staabm commented Nov 8, 2025

In CI the difference is only 20 seconds 🤷‍♂️ .. but still an improvement

@ondrejmirtes ondrejmirtes merged commit 0eb7dff into phpstan:2.1.x Nov 8, 2025
366 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the coverage branch November 8, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants