Page MenuHomePhabricator

Maintain debug settings in MediaWiki core
Closed, ResolvedPublic

Description

Currently there is a set of debug configurations maintained in the mediawiki/conf.d directory of the integration/jenkins.git repository. This is included in (most) Jenkins jobs that run MediaWiki tests (PHPUnit, QUnit or otherwise).

https://github.com/wikimedia/integration-jenkins/tree/master/mediawiki/conf.d

When working locally (e.g. via MediaWiki-Vagrant) or when running tests via Travis CI, however, these settings don't apply.

There are some Jenkins and/or Wikimedia specific things here, but for the most part it might make sense to maintain these in MediaWiki core instead (e.g. tests/DebugTestSettings.php or some such).

At the very least this would contain the following:

// Debugging: PHP
error_reporting( -1 );
ini_set( 'display_errors', 1 );
// Debugging: MediaWiki
$wgDevelopmentWarnings = true;
$wgShowDBErrorBacktrace = true;
$wgShowExceptionDetails = true;
$wgShowSQLErrors = true;

Context: Debugging Postgres failures on Travis CI (T75174) is difficult given by default $wgShowExceptionDetails is false and thus a useless error was shown until manually a pull-request was drafted on GitHub to re-run the tests with this enabled.

We could append this within .travis.yml only, but given that we want the same in Jenkins and other places were we run tests, it might make more sense if MediaWiki had a way of enabling these (and other settings) by default when running tests. Or at least provided a file that can be easily included from various places, which could happen by default in phpunit.php, or perhaps via a command-line switch (opt-in).

Event Timeline

Change 383039 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[integration/jenkins@master] mwconf: Merge 00_set_debug_log into 00_dev_settings

https://gerrit.wikimedia.org/r/383039

Change 383041 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/core@master] tests: Commit initial version of TestSettings.php

https://gerrit.wikimedia.org/r/383041

Change 383040 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[integration/jenkins@master] mwconf: Use built-in TestSettings.php instead when available

https://gerrit.wikimedia.org/r/383040

Change 383039 merged by jenkins-bot:
[integration/jenkins@master] mwconf: Merge 00_set_debug_log into 00_dev_settings

https://gerrit.wikimedia.org/r/383039

Change 383041 merged by jenkins-bot:
[mediawiki/core@master] tests: Commit initial version of DevelopmentSettings.php

https://gerrit.wikimedia.org/r/383041

Change 383040 merged by jenkins-bot:
[integration/jenkins@master] mwconf: Use built-in DevelopmentSettings.php instead when available

https://gerrit.wikimedia.org/r/383040

Change 412825 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[integration/jenkins@master] mwconf: Re-enable use of built-in DevelopmentSettings.php

https://gerrit.wikimedia.org/r/412825

Change 412825 merged by jenkins-bot:
[integration/jenkins@master] mwconf: Re-enable use of built-in DevelopmentSettings.php

https://gerrit.wikimedia.org/r/412825

See also the extension DebugMode, quite versatile and possibly a source of inspiration about good debugging parameters.