You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use pcov => xdebug => phpdbg for phpunit code coverage
Right now we are only using phpdbg for phpunit code coverage. And
it's causing some problems with latest (8.0, 8.1) php versions.
Also, since phpunit 8, its code coverage tool supports pcov, that
is the lighter and better alternative. And then, xdebug running
in coverage mode has become way better in recent versions.
So, with this patch applied, moodle-plugin-ci will look for the
"best" code coverage alternative (pcov => xdebug => phpdbg) in
every run.
This guarantees that existing automations, not having pcov or
xdebug available will continue fall-backing to phpdbg. But if
any of the 2 extensions are available, we'll be using them.
No matter of the above (fully automatic), it's also possible
to configure the desired code coverage tool with 3 new options,
in case it's needed to force any:
- coverage-pcov
- coverage-xdebug
- coverage-phpdbg
Added support to the '--verbose' option to be passed to phpunit
(useful to debug options or see details about skipped tests).
Includes modifications to both GHA docs and template to show the new options.
And, also, changes to own CI tests to have both pcov and xdebug used
all the time.
Copy file name to clipboardExpand all lines: docs/CHANGELOG.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
9
9
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
10
10
11
11
## [Unreleased]
12
+
### Added
13
+
- PHPUnit code coverage will now automatically fallback between `pcov` => `xdebug` => `phpdbg`, using the "best" one available in the system. Still, if needed to, any of them can be forced, given all their requirements are fulfilled, using the following new options of the 'phpunit' command: `--coverage-pcov`, `--coverage-xdebug` or `--coverage-phpdbg`.
14
+
- ACTION SUGGESTED: Ensure that the `pcov` or `xdebug` extensions are installed in your environment to get 'moodle-plugin-ci' using them automatically.
12
15
13
16
## [3.2.6] - 2022-05-10
14
-
### Changed
15
-
- It is possible to specify more test execution options to the 'phpunit' command, such as "--fail-on-warning"
17
+
### Added
18
+
- It is possible to specify more test execution options to the 'phpunit' command, such as `--fail-on-incomplete`, `--fail-on-risky` and `--fail-on-skipped` and `--fail-on-warning`. For more information, see [PHPUnit documentation](https://phpunit.readthedocs.io).
16
19
17
20
### Fixed
18
21
- Locally bundled [moodle-local_codechecker](https://github.com/moodlehq/moodle-local_codechecker) now works ok with recent (Moodle 3.11 and up) branches. A recent change in those versions was causing [some problems](https://tracker.moodle.org/browse/MDL-74704).
Copy file name to clipboardExpand all lines: docs/CodeCoverage.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ title: Generating code coverage
6
6
Currently, code coverage is only generated for builds that are running on PHP7 or later. Code coverage generation
7
7
is significantly faster and easier to produce in PHP7.
8
8
9
+
Code coverage will now automatically fallback between `pcov` => `xdebug` => `phpdbg`, using the "best" one available in the system. Still, if needed to, any of them can be forced, given all their requirements are fulfilled, using the following new options of the 'phpunit' command: `--coverage-pcov`, `--coverage-xdebug` or `--coverage-phpdbg`.
10
+
9
11
The way you generate code coverage is to use one of the coverage options on the `phpunit` command. The currently
10
12
available options are `--coverage-text` and `--coverage-clover`. The easiest way to start generating code coverage
11
13
is to use the text option as that gets printed in the Travis CI logs. Example:
0 commit comments