From a44ddefbf8079c38caf4773e08863c4219df660e Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 6 Apr 2024 16:05:27 +0200 Subject: [PATCH] Deprecate the phpdbg option for code coverage This includes both the current default (when neither pcov or xdebug are available) and the explicit use of --coverage-phpdbg Since PHP 8.0, phpdbg is causing all sort of problems and is not recommended. So it's time to deprecate it in order to proceed to remove it completely for moodle-plugin-ci 5.0.0. Removal ref.: https://github.com/moodlehq/moodle-plugin-ci/issues/289 Fixes #213 --- docs/CHANGELOG.md | 6 ++++++ src/Command/PHPUnitCommand.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 259aa169..7f70c5d3 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning](http://semver.org/). The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com). ## [Unreleased] +### Deprecated +- The use of `phpdbg` to calculate PHPUnit's code-coverage has been deprecated in this `moodle-plugin-ci` release (4.5.0) and will be removed in 5.0.0. This includes both the implicit (default) option when no alternative (`pcov` or `xdebug`) is available and the explicit `--coverage-phpdbg` option. +- ACTION SUGGESTED: In order to avoid deprecation warnings or annotations, proceed to ensure that either `pcov` (Moodle 3.10 and up) or `xdebug` are available and they will be used automatically. Note that any use of `phpdbg` will throw an error in the next major release (5.0.0). + +### Fixed +- Solved a problem with the validation of `dataformat` plugin lang strings. ## [4.4.5] - 2024-04-03 ### Changed diff --git a/src/Command/PHPUnitCommand.php b/src/Command/PHPUnitCommand.php index 7e4728bb..ea2ab565 100644 --- a/src/Command/PHPUnitCommand.php +++ b/src/Command/PHPUnitCommand.php @@ -195,6 +195,10 @@ private function resolveBinary(InputInterface $input, OutputInterface $output): '-dxdebug.mode=coverage', ]; case 'phpdbg': + if (getenv('GITHUB_ACTIONS')) { // Only show deprecation annotations in GitHub Actions. + echo '::warning title=Deprecated phpdbg option::The use of phpdbg for phpunit code coverage ' . + 'is deprecated and will be removed in 5.0.0. Please, switch to pcov or xdebug instead.' . PHP_EOL; + } return [ 'phpdbg', '-d',