Project

General

Profile

Actions

Feature #91691

closed

Add code coverage report to bamboo build

Added by Tymoteusz Motylewski almost 4 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-06-22
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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

codecoverage.jpg (290 KB) codecoverage.jpg Łukasz Uznański, 2021-08-14 08:57
Actions #1

Updated by Tymoteusz Motylewski almost 4 years ago

  • Description updated (diff)
Actions #3

Updated by Łukasz Uznański over 2 years ago

Unit tests coverage raport

Actions #4

Updated by Gerrit Code Review over 2 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

Actions #5

Updated by Gerrit Code Review over 2 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

Actions #6

Updated by Christian Kuhn over 2 years ago

  • Status changed from Under Review to Rejected
Actions

Also available in: Atom PDF