Page MenuHomePhabricator

checkLess.php fails with autoloader not finding PHPUnitMaintClass
Closed, ResolvedPublic

Description

checkLess.php fails with:

vagrant@mediawiki-vagrant:/vagrant/mediawiki/extensions/Flow$ mwscript maintenance/checkLess.php --wiki=wiki
PHPUnit 4.8.24 by Sebastian Bergmann and contributors.

PHP Fatal error:  Class 'PHPUnitMaintClass' not found in /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php on line 1378
PHP Stack trace:
PHP   1. {main}() /var/www/w/MWScript.php:0
PHP   2. require_once() /var/www/w/MWScript.php:95
PHP   3. require_once() /vagrant/mediawiki/maintenance/checkLess.php:66
PHP   4. CheckLess->execute() /vagrant/mediawiki/maintenance/doMaintenance.php:111
PHP   5. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/maintenance/checkLess.php:61
PHP   6. PHPUnit_TextUI_TestRunner->doRun() /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:149
PHP   7. PHPUnit_Framework_TestSuite->run() /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:440
PHP   8. MediaWikiTestCase->run() /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
PHP   9. MediaWikiTestCase->getCliArg() /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:372

Fatal error: Class 'PHPUnitMaintClass' not found in /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php on line 1378

Call Stack:
    0.0005     239704   1. {main}() /var/www/w/MWScript.php:0
    0.0065     304584   2. require_once('/vagrant/mediawiki/maintenance/checkLess.php') /var/www/w/MWScript.php:95
    0.0117     715328   3. require_once('/vagrant/mediawiki/maintenance/doMaintenance.php') /vagrant/mediawiki/maintenance/checkLess.php:66
    0.4522   21501920   4. CheckLess->execute() /vagrant/mediawiki/maintenance/doMaintenance.php:111
    0.4771   22629896   5. PHPUnit_TextUI_Command->run() /vagrant/mediawiki/maintenance/checkLess.php:61
    1.1697   31706928   6. PHPUnit_TextUI_TestRunner->doRun() /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:149
    1.1929   32096248   7. PHPUnit_Framework_TestSuite->run() /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:440
    1.2161   32301976   8. MediaWikiTestCase->run() /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:747
    1.2197   32444016   9. MediaWikiTestCase->getCliArg() /vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:372

I'll put up a WIP that works, but it causes a notice since it's then *double*-included

Details

Related Gerrit Patches:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 19 2016, 2:46 AM

Change 322393 had a related patch set uploaded (by Mattflaschen):
WIP: Fix checkLess.php by updating TestsAutoLoader.php

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

phuedx added a subscriber: phuedx.Apr 18 2017, 10:57 AM

rMWf6496fc47206: WIP: Fix checkLess.php by updating TestsAutoLoader.php definitely works but highlights the awkwardness of the checkLess.php script. Would it be sufficient to replace the script with the following?

checkLess
#/bin/bash

cd "$MW_INSTALL_PATH"
tests/phpunit/phpunit.php --wiki wiki tests/phpunit/suites/LessTestSuite.php
Krinkle moved this task from Inbox to PHPUnit on the MediaWiki-Core-Testing board.Jul 7 2017, 5:10 AM

Change 552295 had a related patch set uploaded (by Florianschmidtwelzow; owner: Florianschmidtwelzow):
[mediawiki/core@master] Fix broken running tests locally in IDE

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

Change 552295 merged by jenkins-bot:
[mediawiki/core@master] Fix broken running tests locally in IDE

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

Florian closed this task as Resolved.Jan 3 2020, 12:20 PM
Florian claimed this task.
Florian added a subscriber: Florian.

Forgot to click "Submit" in my phab UI :D