⚓ T357854 Math CI tests are broken
Page MenuHomePhabricator

Math CI tests are broken
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • submit an empty change to the math extension

What happens?:

Test fail https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Math/+/1004312

00:28:55 1) MediaWiki\Extension\Math\Tests\PreferencesIntegrationTest::testMathOptionRegistered
00:28:55 InvalidArgumentException: Invalid username: 
00:28:55 
00:28:55 /workspace/src/extensions/CentralAuth/includes/User/CentralAuthUser.php:253
00:28:55 /workspace/src/extensions/CentralAuth/includes/User/CentralAuthUser.php:230
00:28:55 /workspace/src/extensions/CentralAuth/includes/CentralAuthHooks.php:141

What should have happened instead?:

test pass

Event Timeline

It could be caused by the same problem as T357746. However I also don't understand the cause for T357746. A quick fix was to skip the test.

Change 1004621 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/Math@master] PreferencesIntegrationTest: Fix mock of `null` User object

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

@Physikerwelt, I was able to track down the issue here. In summary, it's because the mock will return a NULL user object which will break in CA on the onGetPreferences() hook run. I've made a patch to fix this.

DAlangi_WMF changed the task status from Open to In Progress.Feb 19 2024, 10:16 AM
DAlangi_WMF claimed this task.

Change 1004621 merged by jenkins-bot:

[mediawiki/extensions/Math@master] PreferencesIntegrationTest: CA will fail on `null` User objects

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