The fact that this service construction is not tested caused an issue with the train T206161.
Even a simple test just calling the getter for the service would have caught this.
We should add one.
The fact that this service construction is not tested caused an issue with the train T206161.
Even a simple test just calling the getter for the service would have caught this.
We should add one.
We should look to see if this test isn't being run.
As far as I can tell from the CI config WikibaseQualityConstraints should be run with Wikibase, which means that the patch that changed the constructor parameters in Wikibase should naveer have been able to get merged if WBQC was not updated :/
Looks like other things may also not being being properly run:
Locally I get failures like this:
1) WikibaseQuality\ConstraintReport\Tests\Specials\SpecialConstraintReportTest::testExecute with data set "valid input - existing item" ('$id', array(), 'qqx', array(Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), WMDE\HamcrestHtml\ComplexTagMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...), Hamcrest\Core\CombinableMatcher Object (...))) Error: Class 'WikibaseQuality\Html\HtmlTableBuilder' not found /var/www/mediawiki/extensions/WikibaseQualityConstraints/src/Specials/SpecialConstraintReport.php:362 /var/www/mediawiki/extensions/WikibaseQualityConstraints/src/Specials/SpecialConstraintReport.php:269 /var/www/mediawiki/tests/phpunit/includes/specials/SpecialPageExecutor.php:108 /var/www/mediawiki/tests/phpunit/includes/specials/SpecialPageExecutor.php:36 /var/www/mediawiki/tests/phpunit/includes/specials/SpecialPageTestBase.php:70 /var/www/mediawiki/extensions/WikibaseQualityConstraints/tests/phpunit/Specials/SpecialConstraintReportTest.php:153 /var/www/mediawiki/tests/phpunit/MediaWikiTestCase.php:424 /var/www/mediawiki/maintenance/doMaintenance.php:94
which are not occurring on CI.
So we copied over the Html classes from WikibaseQuality into WikibaseQualityConstraints, but didn’t update the imports to refer to the WBQC versions? Sounds like T205063: Merge WikibaseQuality and WikibaseQualityConstraints isn’t done yet, then (or at least we can’t proceed with T205064: Stop loading WikibaseQuality extension on WMF sites yet).
Change 468972 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/WikibaseQualityConstraints@master] DNM Testing if ServicesTest runs
It appears that the SpecialConstraintReportTest failures I get locally do not occur on CI because WikibaseQuality is still being loaded and just the classes aren't missing. Made a new ticket for this at: T207655
It appears to be that the Services tests are running both locally and on CI.
Looking through logstash/kibana it seems that all the errors are coming this sort of path:
#0 /srv/mediawiki/php-1.32.0-wmf.24/extensions/WikibaseQualityConstraints/src/ServiceWiring.php(249): NO_FUNCTION_GIVEN() #1 /srv/mediawiki/php-1.32.0-wmf.24/includes/services/ServiceContainer.php(431): Closure$WikibaseQuality\ConstraintReport\#14(MediaWiki\MediaWikiServices) #2 /srv/mediawiki/php-1.32.0-wmf.24/includes/services/ServiceContainer.php(414): MediaWiki\Services\ServiceContainer->createService(string) #3 /srv/mediawiki/php-1.32.0-wmf.24/extensions/WikibaseQualityConstraints/src/ConstraintsServices.php(43): MediaWiki\Services\ServiceContainer->getService(string) #4 /srv/mediawiki/php-1.32.0-wmf.24/extensions/WikibaseQualityConstraints/src/ConstraintsServices.php(155): WikibaseQuality\ConstraintReport\ConstraintsServices::getService(MediaWiki\MediaWikiServices, string) #5 /srv/mediawiki/php-1.32.0-wmf.24/extensions/WikibaseQualityConstraints/src/Api/CheckConstraintsRdf.php(57): WikibaseQuality\ConstraintReport\ConstraintsServices::getResultsSource() #6 /srv/mediawiki/php-1.32.0-wmf.24/includes/actions/Action.php(109): WikibaseQuality\ConstraintReport\Api\CheckConstraintsRdf::newFromGlobalState(WikiPage, RequestContext) #7 /srv/mediawiki/php-1.32.0-wmf.24/includes/actions/Action.php(156): Action::factory(string, WikiPage, RequestContext) #8 /srv/mediawiki/php-1.32.0-wmf.24/includes/MediaWiki.php(155): Action::getActionName(RequestContext) #9 /srv/mediawiki/php-1.32.0-wmf.24/includes/MediaWiki.php(785): MediaWiki->getAction() #10 /srv/mediawiki/php-1.32.0-wmf.24/includes/MediaWiki.php(525): MediaWiki->main() #11 /srv/mediawiki/php-1.32.0-wmf.24/index.php(42): MediaWiki->run() #12 /srv/mediawiki/w/index.php(3): include(string) #13 {main}
It's not tested because the erroring codepath is only hit if WBQualityConstraintsCacheCheckConstraintsResults config option is set to true
Ah, I see.
I figure we could default that config variable to true by now, anyways… any reason not to?
Change 471002 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/WikibaseQualityConstraints@master] Cache constraints checks by default
The change mentioned above was merged now, anything else left to do here? (Production config should be adjusted as well, but that’s T207854.)
The two services that are obviously switched in the service wiring based on globals are ResultSource and SparqlHelper. I've uploaded a patch to at least be sure that the various possible settings are tested.
I wonder if the solution may be to remove the logic from the service wiring and have Factory services that contain the logic for returning the right type.
Change 471742 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/WikibaseQualityConstraints@master] Test possible global values in ServiceWiring
Whoops, we passed like 'ships in the night' (or should that be 'at lunch'). There is a another patch that should make sure that whatever the globals are set we check that the Wiring will result in a service we can use (or a dummy one we'll ignore).
Change 471742 merged by jenkins-bot:
[mediawiki/extensions/WikibaseQualityConstraints@master] Test possible global values in ServiceWiring