Page MenuHomePhabricator

ApiQueryLanguageinfoTest fails locally due to mismatching Project namespace name
Closed, ResolvedPublic

Description

Follows-up T226072: Provide a way to get localized namespaces names through the API. It seems https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1281626 hardcoded expected values specific to the setup in WMF CI where the wiki and project namespace name happen to be called TestWiki.

$ composer phpunit -- tests/phpunit/includes/Api/Query/

…
There were 3 failures:

1) MediaWiki\Tests\Api\Query\ApiQueryLanguageinfoTest::testAllPropsForSingleLanguage with data set #0 
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
             1 => 'Разговор'
             2 => 'Корисник'
             3 => 'Разговор_с_корисником'
-            4 => 'TestWiki'
-            5 => 'Разговор_о_TestWiki'
+            4 => 'Project'
+            5 => 'Разговор_о_Project'
             6 => 'Датотека'
             7 => 'Разговор_о_датотеци'
             8 => 'Медијавики'
@@ @@
             'Разговор' => 1
             'Корисник' => 2
             'Разговор с корисником' => 3
-            'TestWiki' => 4
-            'Разговор о TestWiki' => 5
             'Датотека' => 6
             'Разговор о датотеци' => 7
             'Медијавики' => 8
@@ @@
             'Razgovor' => 1
             'Korisnik' => 2
             'Razgovor s korisnikom' => 3
-            'Razgovor o TestWiki' => 5
             'Datoteka' => 6
             'Razgovor o datoteci' => 7
             'Medijaviki' => 8
@@ @@
             'Razgovor o pomoći' => 13
             'Kategorija' => 14
             'Razgovor o kategoriji' => 15
+            'Project' => 4
+            'Разговор о Project' => 5
+            'Razgovor o Project' => 5
         )
     )
 )

…

2) MediaWiki\Tests\Api\Query\ApiQueryLanguageinfoTest::testAllPropsForSingleLanguage with data set #1 
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
             3 => 'सदस्य_वार्ता'
             0 => ''
             1 => 'वार्ता'
-            4 => 'TestWiki'
-            5 => 'TestWiki_वार्ता'
+            4 => 'Project'
+            5 => 'Project_वार्ता'
             6 => 'चित्र'
             7 => 'चित्र_वार्ता'
             8 => 'मीडियाविकि'

…

3) MediaWiki\Tests\Api\Query\ApiQueryLanguageinfoTest::testAllPropsForSingleLanguage with data set #2 
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
             1 => 'Talk'
             2 => 'User'
             3 => 'User_talk'
-            4 => 'TestWiki'
-            5 => 'TestWiki_talk'
+            4 => 'Project'
+            5 => 'Project_talk'
             6 => 'File'

Event Timeline

Change #1294472 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] API: Fix ApiQueryLanguageinfoTest to prepare fixture before expectation

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

Change #1294473 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] phpunit: Set wgMetaNamespace in TestSetup to prevent flaky tests

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

Change #1294472 merged by jenkins-bot:

[mediawiki/core@master] API: Fix ApiQueryLanguageinfoTest to prepare fixture before expectation

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

Change #1294473 merged by jenkins-bot:

[mediawiki/core@master] phpunit: Set wgMetaNamespace in TestSetup to prevent flaky tests

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

Umherirrender assigned this task to Krinkle.