Add helpers for running and viewing pcov code coverage #348
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This improvement adds the pcov extention to the PHP 7.3-8.4 containers, and some helper aliases
unit_pcov
,set_coverage
to the PHP container shells to make running code coverage and viewing reports easier.This supports Totara 14 and above (as 13 and below use PHPUnit 8 which has a different configuration)
To test this:
tbuild nginx php-7.3 php-7.4 php-8.0 php-8.1 php-8.2 php-8.3 php-8.4
)tup nginx
tup php && tzsh php
installunit
set_coverage server/lib server/totara/core
(which will add coverage paths for server/lib and server/totara/core)unit_pcov path/to/test.php
and make sure there are no errorsunit path/to/test.php
without any issuesWill update the docker-dev wiki and the public developer docs on coverage once this is tested and merged