Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Nov 5, 2025

goal: speedup the coverage generation process

refs paratestphp/paratest#1044

before this PR

XDEBUG_MODE=coverage php tests/vendor/bin/paratest --coverage-xml=tmp/coverage-xml 
...
Time: 07:41.109, Memory: 618.50 MB

OK, but some tests were skipped!
Tests: 13325, Assertions: 80593, Skipped: 170.

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

after this PR

XDEBUG_MODE=coverage php tests/vendor/bin/paratest --coverage-xml=tmp/coverage-xml 
...
Time: 03:37.977, Memory: 668.50 MB

OK, but some tests were skipped!
Tests: 13325, Assertions: 80593, Skipped: 170.

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

Next: figure out whether we can utilize it and which annotations make sense where

@ondrejmirtes
Copy link
Member

A clean way to get rid of static analysis errors would be for simple-downgrader to downgrade the attribute to @coversNothing.

@staabm
Copy link
Contributor Author

staabm commented Nov 7, 2025

I still need to figure out a good way forward for this Covers* annotations.

If we use CoversNothing it will make tests beeing skipped for infection.
Only thing which makes sense to me is, that we look for real unit tests and mark them with CoversClass(X).
that way we at least reduce the number of test-classes to make coverage generation a bit faster

(I am still learning this Covers* annotations while beeing in constant conversations with Sebastian and the infection team)

@ondrejmirtes
Copy link
Member

There are zero real unit tests 😊 I feel like CoversNothing for a few specific classes like AnalyseeIntegrarionTest is the way to go.

There are some classes in this PR that I disagree with but generally I want CoversNothing here 😊

@staabm
Copy link
Contributor Author

staabm commented Nov 7, 2025

maybe it makes sense you look for the test which fit for CoversNothing?
I don't see others besides AnalyseeIntegrarionTest. I would just start guessing at this point.

@staabm staabm mentioned this pull request Nov 8, 2025
@staabm
Copy link
Contributor Author

staabm commented Nov 8, 2025

closing this, as "POC completed".

Adding the attributes in #4535

@staabm staabm closed this Nov 8, 2025
@staabm staabm deleted the covers branch November 8, 2025 07:42
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