Feature #91691
closedAdd code coverage report to bamboo build
0%
Description
It would be nice to get feedback about test code coverage when pushing a commit to gerrit.
I've played around with PCOV (https://github.com/krakjoe/pcov), and running unit tests with coverage enabled on my local machine took 46.63 seconds (23.74 seconds without coverage enabled),
Generating code coverage report in Clover XML format ... done [15.69 seconds]
Generating code coverage report in HTML format ... done [7.77 seconds]
Here is the config I've used:
#Build/pcov.ini pcov.enabled = 1 pcov.directory = typo3 pcov.exclude="~(vendor|Tests|Resources|Configuration|node_modules)~" pcov.initial.files = 10000 memory_limit = 2G
php -c Build/pcov.ini vendor/phpunit/phpunit/phpunit -c vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml --coverage-html 'reports/clover_html' --coverage-clover 'reports/clover.xml'
We can either generate html coverage report ourselves or push the report to some external tool like https://coveralls.io/.
As a first step the report could be generated in the nightly build , later it could be added to bamboo patchset tests.
To have the most meaningful report we should combine coverage reports from our parallel unit builds and functional tests. This could be achieved using phpunit/phpcov (https://github.com/sebastianbergmann/phpcov):
phpunit --coverage-php build/cov/coverage-${component_name}.cov php vendor/bin/phpcov.php merge --clover build/logs/clover.xml build/cov
Files
Updated by Tymoteusz Motylewski over 3 years ago
Updated by Łukasz Uznański over 3 years ago
- File codecoverage.jpg codecoverage.jpg added
Unit tests coverage raport
Updated by Gerrit Code Review over 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70591
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70591
Updated by Christian Kuhn about 3 years ago
- Status changed from Under Review to Rejected