CirrusSearch tests erroring with WikibaseMediaInfo checked out
Closed, DuplicatePublic

Description

When MedaiInfo is enabled then there are lots of errors with the new UpdaterTest in CirrusSearch

PHPUnit 6.5.13 by Sebastian Bergmann and contributors.

EEEEEEEEEEEEEEEEEE..                                              20 / 20 (100%)

Time: 17.89 seconds, Memory: 48.00MB

There were 18 errors:

1) CirrusSearch\UpdaterTest::testDisplayTitle with data set "null when no display title is set" (null, Title Object (...), false)
TypeError: Argument 3 passed to Wikibase\MediaInfo\WikibaseMediaInfoHooks::onCirrusSearchBuildDocumentParse() must be an instance of AbstractContent, null given, called in /vagrant/mediawiki/includes/Hooks.php on line 174

/vagrant/mediawiki/extensions/WikibaseMediaInfo/src/WikibaseMediaInfoHooks.php:342
/vagrant/mediawiki/includes/Hooks.php:174
/vagrant/mediawiki/includes/Hooks.php:202
/vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php:368
/vagrant/mediawiki/extensions/CirrusSearch/tests/phpunit/UpdaterTest.php:95
/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:409
/vagrant/mediawiki/maintenance/doMaintenance.php:94

2) CirrusSearch\UpdaterTest::testDisplayTitle with data set "null when display title matches normal title (ns_main)" (null, Title Object (...), 'Phpunit')
TypeError: Argument 3 passed to Wikibase\MediaInfo\WikibaseMediaInfoHooks::onCirrusSearchBuildDocumentParse() must be an instance of AbstractContent, null given, called in /vagrant/mediawiki/includes/Hooks.php on line 174

/vagrant/mediawiki/extensions/WikibaseMediaInfo/src/WikibaseMediaInfoHooks.php:342
/vagrant/mediawiki/includes/Hooks.php:174
/vagrant/mediawiki/includes/Hooks.php:202
/vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php:368
/vagrant/mediawiki/extensions/CirrusSearch/tests/phpunit/UpdaterTest.php:95
/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:409
/vagrant/mediawiki/maintenance/doMaintenance.php:94

3) CirrusSearch\UpdaterTest::testDisplayTitle with data set "null when display title matches normal title without namespace prefix" (null, Title Object (...), 'Phpunit')
TypeError: Argument 3 passed to Wikibase\MediaInfo\WikibaseMediaInfoHooks::onCirrusSearchBuildDocumentParse() must be an instance of AbstractContent, null given, called in /vagrant/mediawiki/includes/Hooks.php on line 174

/vagrant/mediawiki/extensions/WikibaseMediaInfo/src/WikibaseMediaInfoHooks.php:342
/vagrant/mediawiki/includes/Hooks.php:174
/vagrant/mediawiki/includes/Hooks.php:202
/vagrant/mediawiki/extensions/CirrusSearch/includes/Updater.php:368
/vagrant/mediawiki/extensions/CirrusSearch/tests/phpunit/UpdaterTest.php:95
/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:409
/vagrant/mediawiki/maintenance/doMaintenance.php:94

etc.

Cparle created this task.Sep 20 2018, 10:42 AM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptSep 20 2018, 10:42 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 461621 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/CirrusSearch@master] Mocked getContent method of mock Page object

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

Change 461622 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/CirrusSearch@master] Mocked getContent method of mock Page object

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

Change 461621 abandoned by Cparle:
Mocked getContent method of mock Page object

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

Change 461623 had a related patch set uploaded (by Cparle; owner: Cparle):
[mediawiki/extensions/CirrusSearch@master] Mocked getContent method of mock Page object

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

Change 461623 abandoned by Cparle:
Mocked getContent method of mock Page object

Reason:
Somehow I have 2 patches for the same thing ...

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

Cparle claimed this task.Sep 20 2018, 11:11 AM

Change 461622 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Mocked getContent method of mock Page object

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