Page MenuHomePhabricator

Fix ApiDocumentationTest on CentralAuth
Closed, ResolvedPublic

Description

Failures from new tests in Ida7e5720fe304c5168fe752b1b5485fe4cb2cb45 needs fixing:

01:39:33 1) ApiDocumentationTest::testDocumentationExists with data set "Module query+globalallusers with MiserMode=false, AllowCategorizedRecentChanges=false" ('query+globalallusers', array(false, false))
01:39:33 DBConnectionError: DB connection error: Access denied for user 'jenkins_u3'@'127.0.0.1' to database 'centralauth' (127.0.0.1:3306)
01:39:33 
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/Database.php:871
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:869
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:565
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:127
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:2738
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/api/ApiQueryGlobalAllUsers.php:233
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiBase.php:2208
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/includes/TestingAccessWrapper.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/MediaWikiTestCase.php:137
01:39:33 
01:39:33 2) ApiDocumentationTest::testDocumentationExists with data set "Module query+globalallusers with MiserMode=true, AllowCategorizedRecentChanges=true" ('query+globalallusers', array(true, true))
01:39:33 DBConnectionError: DB connection error: Access denied for user 'jenkins_u3'@'127.0.0.1' to database 'centralauth' (127.0.0.1:3306)
01:39:33 
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/Database.php:871
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:869
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:565
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:127
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:2738
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/api/ApiQueryGlobalAllUsers.php:233
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiBase.php:2208
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/includes/TestingAccessWrapper.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/MediaWikiTestCase.php:137
01:39:33 
01:39:33 3) ApiDocumentationTest::testDocumentationExists with data set "Module globaluserrights with MiserMode=false, AllowCategorizedRecentChanges=false" ('globaluserrights', array(false, false))
01:39:33 DBConnectionError: DB connection error: Access denied for user 'jenkins_u3'@'127.0.0.1' to database 'centralauth' (127.0.0.1:3306)
01:39:33 
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/Database.php:871
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:869
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:565
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:127
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:2738
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/api/ApiGlobalUserRights.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiUserrights.php:113
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiBase.php:2208
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/includes/TestingAccessWrapper.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/MediaWikiTestCase.php:137
01:39:33 
01:39:33 4) ApiDocumentationTest::testDocumentationExists with data set "Module globaluserrights with MiserMode=true, AllowCategorizedRecentChanges=true" ('globaluserrights', array(true, true))
01:39:33 DBConnectionError: DB connection error: Access denied for user 'jenkins_u3'@'127.0.0.1' to database 'centralauth' (127.0.0.1:3306)
01:39:33 
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/Database.php:871
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:869
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/db/loadbalancer/LoadBalancer.php:565
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:127
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/CentralAuthUser.php:2738
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/extensions/CentralAuth/includes/api/ApiGlobalUserRights.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiUserrights.php:113
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/includes/api/ApiBase.php:2208
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/includes/TestingAccessWrapper.php:34
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ApiDocumentationTest.php:80
01:39:33 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/MediaWikiTestCase.php:137
01:39:33

Event Timeline

Umherirrender raised the priority of this task from to Needs Triage.
Umherirrender updated the task description. (Show Details)
Umherirrender added subscribers: Umherirrender, Anomie.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 20 2015, 3:47 PM
Reedy updated the task description. (Show Details)Dec 20 2015, 4:05 PM
Reedy set Security to None.

It looks like something in the CI infrastructure rather than the test itself, since the errors are Access denied for user 'jenkins_u3'@'127.0.0.1' to database 'centralauth'. Do we need to mark the test class as @group Database or something like that to convince the infrastructure to set things up properly?

hoo added a subscriber: hoo.Dec 22 2015, 4:39 PM

CentralAuth doesn't create its tables during a update.php run, thus the tables in question aren't there (and neither is the database, for that matter). Not sure how to work around that best… one option would be to just catch such errors and ignore the API modules in question.

Change 260397 had a related patch set uploaded (by Anomie):
Add missing API i18n message, and override DB for WMF Jenkins

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

hashar added a subscriber: hashar.Dec 22 2015, 4:55 PM

Since CI only creates a single database, one could look whether $wgWikimediaJenkinsCI is set and set the global. We did that for GlobalBlocking.php

https://gerrit.wikimedia.org/r/#/c/143253/1/GlobalBlocking.php,cm

I am not sure though how you can trigger the update / database setup though.

Change 260397 merged by jenkins-bot:
Add missing API i18n message, and override DB for WMF Jenkins

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

Umherirrender closed this task as Resolved.Jan 1 2016, 5:25 PM
Umherirrender assigned this task to Anomie.