Support --exclude-source-from-xml-coverage fast path for PHPUnit 12.5+#2604
Support --exclude-source-from-xml-coverage fast path for PHPUnit 12.5+#2604theofidry merged 3 commits intoinfection:masterfrom
--exclude-source-from-xml-coverage fast path for PHPUnit 12.5+#2604Conversation
c88c990 to
37177cb
Compare
| } | ||
|
|
||
| #[Group('integration')] | ||
| public function test_it_provides_initial_test_run_command_line_when_coverage_report_is_requested_and_pcov_is_in_use(): void |
There was a problem hiding this comment.
initially I tried to use a data-provider on this test, but because of the exzessiv use of mocks we nearly need to change every line. therefore a data-provider would need a lot of parameters and this would turn this test into a unreadable mess.
therefore I decided to add a separate test to not overcomplicate things.
tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php
Outdated
Show resolved
Hide resolved
|
I think we should wait until PHPUnit 12.5.0 is released before merging. Feedback is welcome before that though :)
|
tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php
Outdated
Show resolved
Hide resolved
|
Let's wait for PHPUnit 12.5.0 then! |
|
since 12.5.0 was released today, this should be good to go |
|
Thank you @staabm! I'm kinda curious how drastic the size is gonna be, looking forward to check it out in the Infection benchmark-source. |
|
another data-point: while coverage-xml report generation was already super fast (~100ms) when running on the ParaTest codebase, adding |
|
Before: After: So it was 14% faster and 50% lighter. |
requires
<source>element in XML code coverage report optional sebastianbergmann/phpunit#6422PhpUnitAdapterTestto ease testing of PHPUnit version dependent behaviour #2607when PHPUnit needs to generate the
<source>element in coverage-xml reports it spents a considerable amount of time generating the this information. infection does not make use of it though.therefore we utilize
--exclude-source-from-xml-coveragewhich will be available as of PHPUnit 12.5+ to prevent this unnecessary work and speedup the process. on phpstan-src we can see a ~15% speedup of the coverage-xml generation process (which takes up to 1 minute in CI)