Page MenuHomePhabricator
Paste P9047

Convert Cirrus tests to MediaWikiUnitTestCase
ActivePublic

Authored by dcausse on Sep 6 2019, 9:42 AM.
```
/vagrant/mediawiki/tests/phpunit/MediaWikiUnitTestCase.php:95
Caused by
ConfigException: GlobalVarConfig::get: undefined option: 'StatsdMetricPrefix' in /vagrant/mediawiki/includes/config/GlobalVarConfig.php:53
Stack trace:
#0 /vagrant/mediawiki/includes/ServiceWiring.php(743): GlobalVarConfig->get('StatsdMetricPre...')
#1 /vagrant/mediawiki/includes/libs/services/ServiceContainer.php(458): Wikimedia\Services\ServiceContainer->{closure}(Object(MediaWiki\MediaWikiServices))
#2 /vagrant/mediawiki/includes/libs/services/ServiceContainer.php(427): Wikimedia\Services\ServiceContainer->createService('StatsdDataFacto...')
#3 /vagrant/mediawiki/includes/MediaWikiServices.php(1003): Wikimedia\Services\ServiceContainer->getService('StatsdDataFacto...')
#4 /vagrant/mediawiki/extensions/CirrusSearch/includes/ElasticsearchIntermediary.php(294): MediaWiki\MediaWikiServices->getStatsdDataFactory()
#5 /vagrant/mediawiki/extensions/CirrusSearch/includes/ElasticsearchIntermediary.php(178): CirrusSearch\ElasticsearchIntermediary->finishRequest(Object(Mock_Connection_cf260bd9))
#6 /vagrant/mediawiki/extensions/CirrusSearch/includes/Version.php(45): CirrusSearch\ElasticsearchIntermediary->success()
#7 /vagrant/mediawiki/extensions/CirrusSearch/tests/phpunit/unit/VersionTest.php(19): CirrusSearch\Version->get()
#8 [internal function]: CirrusSearch\VersionTest->testHappyPath()
#9 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php(1071): ReflectionMethod->invokeArgs(Object(CirrusSearch\VersionTest), Array)
#10 /vagrant/mediawiki/tests/phpunit/MediaWikiUnitTestCase.php(93): PHPUnit\Framework\TestCase->runTest()
#11 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php(939): MediaWikiUnitTestCase->runTest()
#12 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestResult.php(698): PHPUnit\Framework\TestCase->runBare()
#13 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestCase.php(894): PHPUnit\Framework\TestResult->run(Object(CirrusSearch\VersionTest))
#14 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#15 /vagrant/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php(755): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#16 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(545): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#17 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(195): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#18 /vagrant/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php(148): PHPUnit\TextUI\Command->run(Array, true)
#19 /vagrant/mediawiki/vendor/phpunit/phpunit/phpunit(53): PHPUnit\TextUI\Command::main()
#20 {main}
1105) CirrusSearch\VersionTest::testFailure
PHPUnit\Framework\Exception: Config variables must be mocked, they cannot be accessed directly in tests which extend MediaWikiUnitTestCase
```

Event Timeline

dcausse created this paste.Sep 6 2019, 9:42 AM
dcausse edited the content of this paste. (Show Details)