Page MenuHomePhabricator

DefaultPreferencesFactoryTest fails when run on its own
Closed, ResolvedPublic

Description

php tests/phpunit/phpunit.php tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php

Using PHP 7.4.26
PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

.....EE..EEI.                                                     13 / 13 (100%)

Time: 2.21 seconds, Memory: 79.00 MB

There were 4 errors:

1) DefaultPreferencesFactoryTest::testShowRollbackConfIsHiddenForUsersWithoutRollbackRights
Error: Call to a member function getSession() on null

/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1429
/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1369
/Users/kostajh/src/mediawiki/w/extensions/Echo/includes/EchoHooks.php:309
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:338
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:137
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookRunner.php:1909
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:248
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:211
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
===

2) DefaultPreferencesFactoryTest::testShowRollbackConfIsShownForUsersWithRollbackRights
Error: Call to a member function getSession() on null

/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1429
/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1369
/Users/kostajh/src/mediawiki/w/extensions/Echo/includes/EchoHooks.php:309
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:338
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:137
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookRunner.php:1909
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:248
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:231
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
===

3) DefaultPreferencesFactoryTest::testVariantsSupport
Error: Call to a member function getSession() on null

/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1429
/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1369
/Users/kostajh/src/mediawiki/w/extensions/Echo/includes/EchoHooks.php:309
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:338
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:137
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookRunner.php:1909
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:248
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:371
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
===

4) DefaultPreferencesFactoryTest::testUserGroupMemberships
Error: Call to a member function getSession() on null

/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1429
/Users/kostajh/src/mediawiki/w/includes/Permissions/PermissionManager.php:1369
/Users/kostajh/src/mediawiki/w/extensions/Echo/includes/EchoHooks.php:309
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:338
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookContainer.php:137
/Users/kostajh/src/mediawiki/w/includes/HookContainer/HookRunner.php:1909
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:248
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:396
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[UserOptionsManager] [debug] Loading options from database {"user_id":0}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
[CentralAuthVerbose] [info] Loading state for global user {user} from DB {"user":"","private":false}
[CentralAuthVerbose] [info] Loading attached wiki list for global user  from DB {"private":false}
[CentralAuthVerbose] [info] Loading groups for global user {user} {"user":"","private":false}
[objectcache] [debug] fetchOrRegenerate(global:centralauth-user:d41d8cd98f00b204e9800998ecf8427e): miss, new value computed []
[CentralAuthVerbose] [info] Loading CentralAuthUser for user {user} from cache object {"user":"","private":false}
===

ERRORS!
Tests: 13, Assertions: 28, Errors: 4, Incomplete: 1.


You should really speed up these slow tests (>50ms)...
 1. 200ms to run DefaultPreferencesFactoryTest:testIntvalFilter
 2. 158ms to run DefaultPreferencesFactoryTest:testGetForm
 3. 94ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #0
 4. 68ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #2
 5. 67ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #1

Event Timeline

Change 743913 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] phpunit: Don't get user rights from session in test context

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

Change 743913 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] phpunit: Don't get user rights from session in test context

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

After this patch, the next failure is:

Using PHP 7.4.26
PHPUnit 8.5.21 by Sebastian Bergmann and contributors.

.....EE..EEI.                                                     13 / 13 (100%)

Time: 2.48 seconds, Memory: 79.00 MB

There were 4 errors:

1) DefaultPreferencesFactoryTest::testShowRollbackConfIsHiddenForUsersWithoutRollbackRights
MWException: Default 'null' is invalid for preference cirrussearch-pref-completion-profile of user

/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:298
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:250
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:211
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[CentralAuthVerbose] [info] Loading state for global user {user} from DB {"user":"","private":false}
[CentralAuthVerbose] [info] Loading attached wiki list for global user  from DB {"private":false}
[CentralAuthVerbose] [info] Loading groups for global user {user} {"user":"","private":false}
[objectcache] [debug] fetchOrRegenerate(global:centralauth-user:d41d8cd98f00b204e9800998ecf8427e): miss, new value computed []
[CentralAuthVerbose] [info] Loading CentralAuthUser for user {user} from cache object {"user":"","private":false}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
===

2) DefaultPreferencesFactoryTest::testShowRollbackConfIsShownForUsersWithRollbackRights
MWException: Default 'null' is invalid for preference cirrussearch-pref-completion-profile of user

/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:298
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:250
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:231
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
===

3) DefaultPreferencesFactoryTest::testVariantsSupport
MWException: Default 'null' is invalid for preference cirrussearch-pref-completion-profile of user

/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:298
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:250
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:371
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
===

4) DefaultPreferencesFactoryTest::testUserGroupMemberships
MWException: Default 'null' is invalid for preference cirrussearch-pref-completion-profile of user

/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:298
/Users/kostajh/src/mediawiki/w/includes/preferences/DefaultPreferencesFactory.php:250
/Users/kostajh/src/mediawiki/w/tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php:396
/Users/kostajh/src/mediawiki/w/tests/phpunit/MediaWikiIntegrationTestCase.php:452
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[localisation] [debug] LocalisationCache using store LCStoreNull []
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"EmptyBagOStuff"}
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[UserOptionsManager] [debug] Loading options from database {"user_id":0}
[Parser] [debug] Parser::setOutputFlag: set user-signature flag on 'DefaultPreferencesFactoryTest'; User signature detected []
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
[GlobalTitleFail] [info] MessageCache::parse called with no title set. {"exception":{}}
===

ERRORS!
Tests: 13, Assertions: 28, Errors: 4, Incomplete: 1.


You should really speed up these slow tests (>50ms)...
 1. 215ms to run DefaultPreferencesFactoryTest:testIntvalFilter
 2. 156ms to run DefaultPreferencesFactoryTest:testGetForm
 3. 91ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #0
 4. 88ms to run DefaultPreferencesFactoryTest:testShowRollbackConfIsHiddenForUsersWithoutRollbackRights
 5. 76ms to run DefaultPreferencesFactoryTest:testUserGroupMemberships
 6. 72ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #1
 7. 67ms to run DefaultPreferencesFactoryTest:testEmailAuthentication with data set #2
 8. 67ms to run DefaultPreferencesFactoryTest:testVariantsSupport
 9. 54ms to run DefaultPreferencesFactoryTest:testShowRollbackConfIsShownForUsersWithRollbackRights

Change 743925 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/CirrusSearch@master] Hooks: Set default value for completion profile

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

Change 743925 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Hooks: Set default value for completion profile

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

Change 743913 merged by jenkins-bot:

[mediawiki/core@master] phpunit: Mock session object for user in DefaultPreferencesFactoryTest

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

php phpunit.php …/DefaultPreferencesFactoryTest.php

.....EE..EEI.                                                     13 / 13 (100%)

Time: 2.21 seconds
There were 4 errors:
Tests: …, Errors: 4, Incomplete: 1.

This test, run alone, is now down to 0 test errors. However the "incomplete" test remains. Unfortunately, it seems we have PHPUnit configured such that it prints absolutely no details about this incomplete test. Neither its name, nor the error message. I've modified the code (after some git-grepping and guessing as to which markTestIncomplete call is responsible), to find the problem:

--- a/tests/phpunit/includes/config/TestAllServiceOptionsUsed.php
+++ b/tests/phpunit/includes/config/TestAllServiceOptionsUsed.php
@@ -41,8 +41,9 @@ trait TestAllServiceOptionsUsed {
 		);
 
 		if ( $expectedUnused ) {
-			$this->markTestIncomplete( 'Some ServiceOptions keys are not yet accessed by tests: ' .
+			$this->assertSame( '', 'Some ServiceOptions keys are not yet accessed by tests: ' .
 				implode( ', ', $expectedUnused ) );
 		}
 	}
 }
There was 1 failure:

1) DefaultPreferencesFactoryTest::testAllServiceOptionsUsed
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-''
+'Some ServiceOptions keys are not yet accessed by tests: EnotifMinorEdits, EnotifRevealEditorAddress, SignatureValidation'

Adding @matmarex who wrote the original tests. Is there a way to make DefaultPreferencesFactoryTest::testAllServiceOptionsUsed standalone?

Adding @matmarex who wrote the original tests. Is there a way to make DefaultPreferencesFactoryTest::testAllServiceOptionsUsed standalone?

I did not write that test, I only added an entry (in df7231ad). @Simetrical wrote it in b058a0e5.

But, as I understand it, there is no way to do that. This test basically tests that all of the other tests are written well. It can't test that when the other tests don't run (which is probably why it is marked as incomplete in this case, rather than failing).

I don't think this needs any changes.

Change 748314 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[integration/quibble@master] [DNM] Add excimer config

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

Change 774993 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/CirrusSearch@master] Revert "Hooks: Set default value for completion profile"

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

Change 775273 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] phpunit: Fallback to global default user options

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

Change 774993 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@master] Revert "Hooks: Set default value for completion profile"

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

Change 775000 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/CirrusSearch@REL1_38] Revert "Hooks: Set default value for completion profile"

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

Change 775273 merged by jenkins-bot:

[mediawiki/core@master] phpunit: Fallback to global default user options

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

Change 775000 merged by jenkins-bot:

[mediawiki/extensions/CirrusSearch@REL1_38] Revert "Hooks: Set default value for completion profile"

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

TestAllServiceOptionsUsed probably should do nothing if the whole suite is not being run?

Change 820588 had a related patch set uploaded (by Brian Wolff; author: Func):

[mediawiki/core@REL1_38] phpunit: Fallback to global default user options

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

Change 820588 merged by jenkins-bot:

[mediawiki/core@REL1_38] phpunit: Fallback to global default user options

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

I keep getting:

1) DefaultPreferencesFactoryTest::testAllServiceOptionsUsed
Some ServiceOptions keys were not accessed in tests. If they really aren't used, remove them from the class' option list. If they are used, add tests to cover them, or ignore the problem for now by passing them to assertAllServiceOptionsUsed() in its $expectedUnused argument.
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
-Array &0 ()
+Array &0 (
+    4 => 'DefaultSkin'
+)

I keep getting:

1) DefaultPreferencesFactoryTest::testAllServiceOptionsUsed
Some ServiceOptions keys were not accessed in tests. If they really aren't used, remove them from the class' option list. If they are used, add tests to cover them, or ignore the problem for now by passing them to assertAllServiceOptionsUsed() in its $expectedUnused argument.
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
-Array &0 ()
+Array &0 (
+    4 => 'DefaultSkin'
+)

Seemed to be due to not calling wfLoadSkin() during the unit testing case (vs page views).

Daimona assigned this task to kostajh.
Daimona subscribed.

This test, run alone, is now down to 0 test errors. However the "incomplete" test remains.

I can confirm this, hence closing as resolved:

I have no name!@36b6e8303158:/var/www/html/w$ composer phpunit:entrypoint -- tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php 
> phpunit '-c' 'tests/phpunit/suite.xml' 'tests/phpunit/includes/preferences/DefaultPreferencesFactoryTest.php'
Using PHP 8.1.20
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

............I.                                                    14 / 14 (100%)

Time: 00:00.874, Memory: 64.50 MB

OK, but incomplete, skipped, or risky tests!
Tests: 14, Assertions: 41, Incomplete: 1.

Unfortunately, it seems we have PHPUnit configured such that it prints absolutely no details about this incomplete test. Neither its name, nor the error message.

FTR, you can get those details by passing --verbose to PHPUnit. Having it on by default would be too noisy I think, because it also prints details about skipped tests etc.