Skip to content

Add --exclude-source-from-xml-coverage support#1056

Merged
Slamdunk merged 3 commits intoparatestphp:7.xfrom
staabm:excl
Dec 9, 2025
Merged

Add --exclude-source-from-xml-coverage support#1056
Slamdunk merged 3 commits intoparatestphp:7.xfrom
staabm:excl

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 6, 2025

tested it manually with
(since the test-suite seem not to have a test for coverage-xml).

XDEBUG_MODE=coverage bin/paratest --coverage-xml tmp/coverage 
...
Generating code coverage report in PHPUnit XML format ... done [00:00.097]

and

XDEBUG_MODE=coverage bin/paratest --coverage-xml tmp/coverage --exclude-source-from-xml-coverage
...
Generating code coverage report in PHPUnit XML format ... done [00:00.046]

note: the report generation is 50% faster

I verified manually that the generated report no longer contains a <source> element, when invoked with --exclude-source-from-xml-coverage

refs sebastianbergmann/phpunit#6422

@Slamdunk
Copy link
Member

Slamdunk commented Dec 6, 2025

Would it make sense to add it to \ParaTest\Options::OPTIONS_TO_KEEP_FOR_PHPUNIT_IN_WORKER as well?

@staabm
Copy link
Contributor Author

staabm commented Dec 6, 2025

Would it make sense to add it to \ParaTest\Options::OPTIONS_TO_KEEP_FOR_PHPUNIT_IN_WORKER as well?

tbh, I am not sure.

there is another similar option which refines coverage-text - namely only-summary-for-coverage-text - which is not contained in OPTIONS_TO_KEEP_FOR_PHPUNIT_IN_WORKER either.

@Slamdunk
Copy link
Member

Slamdunk commented Dec 6, 2025

there is another similar option[...]

Don't take for granted that every option has been thoroughly scrutinized in the making of OPTIONS_TO_KEEP_FOR_PHPUNIT_IN_WORKER 😅

Give it a try

@staabm
Copy link
Contributor Author

staabm commented Dec 6, 2025

Give it a try

I added it and it does not seem to make a difference from what I can tell.
(I don't know where to look for though)

@staabm staabm force-pushed the excl branch 2 times, most recently from cc21865 to f9480a4 Compare December 6, 2025 09:39
@staabm
Copy link
Contributor Author

staabm commented Dec 6, 2025

don't know what todo with this PHPStan error, as I am not able to reproduce it locally

@staabm
Copy link
Contributor Author

staabm commented Dec 9, 2025

@Slamdunk I think it should be good to go

@Slamdunk Slamdunk changed the title Add --exclude-source-from-xml-coverage support Add --exclude-source-from-xml-coverage support Dec 9, 2025
@Slamdunk Slamdunk merged commit a10878e into paratestphp:7.x Dec 9, 2025
10 checks passed
@staabm staabm deleted the excl branch December 9, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants