moodlehq / moodle-plugin-ci

Helps running Moodle plugins analysis checks and tests under various CI environments.
https://moodlehq.github.io/moodle-plugin-ci/
GNU General Public License v3.0
47 stars 46 forks source link

Investigate why GHA is unable to detect PHP notices/warnings/errors and debugging in logs #103

Open stronk7 opened 3 years ago

stronk7 commented 3 years ago

While working on adding PHP 8 support... it was detected that there are, right now, some PHP Warnings happening with some deprecated code in the behat tool-chain.

PHP Deprecated:  Method ReflectionParameter::getClass() is deprecated in /h  
538  ome/travis/build/moodle/vendor/behat/mink-extension/src/Behat/MinkExtension  
539  /ServiceContainer/Driver/GoutteFactory.php on line 119                       
540  PHP Deprecated:  Method ReflectionParameter::getClass() is deprecated in /h  
541  ome/travis/build/moodle/vendor/behat/mink-extension/src/Behat/MinkExtension  
542  /ServiceContainer/Driver/GoutteFactory.php on line 119

This is being tracked (to get rid of the warnings) @ https://tracker.moodle.org/browse/MDL-71622

Curiously... that is detected by moodle-plugin-ci under Travis (see https://travis-ci.com/github/moodlehq/moodle-local_codechecker/jobs/505447157 for example), but GHA passes without problem.

So, while it's "nice" to have GHA passing, strictly speaking it should not and the very same PHP Warnings should lead to a failure.

Not sure if that is because of some different PHP setting, or because of the way stdout/stderr are handled in both environments... but we need them to behave the same (ideally detecting the errors).

mackensen commented 3 years ago

@stronk7 is there a way to work around this while MDL-71622 is pending? I have a plugin that I can't migrate from travis to GHA...

stronk7 commented 3 years ago

Hi @mackensen,

only workaround I can imagine right now is to disable the PHP 8.0 builds while the MDL-71622 becomes merged upstream. I remember that I tried some potential workarounds like running moodle-plugin-ci install || true or looking if there was any switch to disable the error log/debugging detections but found nothing.

May, I've not tried here, you can try disabling error output or something like that, but I'm not sure if that works because moodle-plugin-ci install itself sets it back, from memory.

So, yes, right now... to keep the PHP 8.0 builds disabled seems to be the only way.

Ciao :-)