Page MenuHomePhabricator

GlobalPreferences test makes TheWikipediaLibrary gate pipeline build fail
Closed, ResolvedPublic

Description

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/TheWikipediaLibrary/+/1026795

12:23:13 1) phpunit\ApiGlobalPreferencesTest::testExecute with data set "set userjs" (array('userjs-foo=bar'), array(), array('bar'))
12:23:13 ApiUsageException: Current user is not global.
12:23:13 
12:23:13 /workspace/src/includes/api/ApiUsageException.php:73
12:23:13 /workspace/src/includes/api/ApiBase.php:1543
12:23:13 /workspace/src/extensions/GlobalPreferences/includes/ApiGlobalPreferences.php:52
12:23:13 /workspace/src/includes/api/ApiMain.php:1948
12:23:13 /workspace/src/includes/api/ApiMain.php:893
12:23:13 /workspace/src/tests/phpunit/includes/api/ApiTestCase.php:183
12:23:13 /workspace/src/tests/phpunit/includes/api/ApiTestCase.php:223
12:23:13 /workspace/src/extensions/GlobalPreferences/tests/phpunit/ApiGlobalPreferencesTest.php:46
12:23:13 /workspace/src/tests/phpunit/includes/api/ApiTestCase.php:334
12:23:13 phpvfscomposer:///workspace/src/vendor/phpunit/phpunit/phpunit:106

Event Timeline

@Samwalton9-WMF is there a separate tag for the library extension?

@Samwalton9-WMF is there a separate tag for the library extension?

No, it's so small we never bothered.

jsn.sherman triaged this task as Unbreak Now! priority.
jsn.sherman moved this task from Ready to In Progress on the Moderator-Tools-Team (Kanban) board.

@taavi I do not believe that our extension is the source of the issue. In my local environment, I commented out TheWikipediaLibrary extension

// wfLoadExtension( 'TheWikipediaLibrary' );

and moved the repo out of ./mediawiki/extensions.

When I run the GlobalPreferences tests, I still get the same error.

$ docker compose exec mediawiki composer phpunit:entrypoint -- --filter "GlobalPreferences"
> phpunit '--filter' 'GlobalPreferences'
Using PHP 8.1.20
Running with MediaWiki settings because there might be integration tests
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

........EEEEEE...........................................         57 / 57 (100%)

Time: 00:01.130, Memory: 363.00 MB

There were 6 errors:

1) phpunit\ApiGlobalPreferencesTest::testExecute with data set "set userjs" (array('userjs-foo=bar'), array(), array('bar'))
ApiUsageException: Current user is not global.
[...]
Func renamed this task from TheWikipediaLibrary makes GlobalPreferences tests fail to GlobalPreferences makes TheWikipediaLibrary tests fail.May 6 2024, 2:02 PM

I think I can fix the GlobalPreferences test; working up a patch now!

Func renamed this task from GlobalPreferences makes TheWikipediaLibrary tests fail to GlobalPreferences test makes TheWikipediaLibrary gate pipeline build fail.May 6 2024, 2:06 PM

Change #1028591 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/GlobalPreferences@master] ApiGlobalPreferencesTest: attach central auth user

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

Change #1029172 had a related patch set uploaded (by Jsn.sherman; author: Jsn.sherman):

[mediawiki/extensions/GlobalPreferences@master] ApiGlobalPreferencesTest: do local CentralIdLookup

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

Change #1028591 abandoned by Jsn.sherman:

[mediawiki/extensions/GlobalPreferences@master] ApiGlobalPreferencesTest: attach central auth user

Reason:

abandoned in favor of I531731027c9a8fb63c39a1a9bf0da94c6fe412da

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

Change #1029172 merged by jenkins-bot:

[mediawiki/extensions/GlobalPreferences@master] ApiGlobalPreferencesTest: do local CentralIdLookup

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

jsn.sherman moved this task from Code review to Done on the Moderator-Tools-Team (Kanban) board.

Verified fixed via successful merge of https://gerrit.wikimedia.org/r/1026795