-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use pcov => xdebug => phpdbg for phpunit code coverage #166
Conversation
fb69f86
to
5712b3b
Compare
Hi super @scara ! Are you going to complete the review of this issue? TIA and no worries if you cannot! Ciao :-) |
Ping! |
Hi @stronk7,
Will look in the next days, within the week. HTH, |
Awesome! TIA! |
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.
5712b3b
to
a0bec99
Compare
I've commented in the 3 places now: travis.yml and .github/workflows/test.yml with the very same comment:
Those are all the changes applied. Ciao :-) |
Thanks, @scara . Going to merge this now! |
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:
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.