From c1cd8d8b1ed5b1a5468cbd469b90a040e0bd1c8b Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Wed, 25 Jun 2025 19:28:54 +0200 Subject: [PATCH] tests: move slow ScopeStructureTest out of structure While looking at the list of tests for an extension I found 3000+ ScopeStructureTest which are generated from the php files in mediawiki/core (more precisely `$wgAutoloadLocalClasses`): * those tests take 21 seconds to complete on my machine. * None were generated for the extension being tested, those tests are thus solely affected by mediawiki/core. `tests/phpunit/structure` is included in the `extensions` and `skins` PHPUnit testsuites and any patches made to them would run that 21 seconds suite even though its only testing mediawiki/core. Move the test outside of `structure` so it is no longer run for `extensions` and `skins`. Bug: T225730 Change-Id: I628210b8b270773f3dad12bbde9d72f0328fcceb (cherry picked from commit d10835b8bc933a49724010f0c39dfeaccfa9108c) --- tests/phpunit/{structure => unit}/ScopeStructureTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/phpunit/{structure => unit}/ScopeStructureTest.php (96%) diff --git a/tests/phpunit/structure/ScopeStructureTest.php b/tests/phpunit/unit/ScopeStructureTest.php similarity index 96% rename from tests/phpunit/structure/ScopeStructureTest.php rename to tests/phpunit/unit/ScopeStructureTest.php index 90a8a2a0058..110b07df055 100644 --- a/tests/phpunit/structure/ScopeStructureTest.php +++ b/tests/phpunit/unit/ScopeStructureTest.php @@ -9,7 +9,7 @@ use PhpParser\PhpVersion; /** * @coversNothing */ -class ScopeStructureTest extends MediaWikiIntegrationTestCase { +class ScopeStructureTest extends MediaWikiUnitTestCase { public static function provideAutoloadNoFileScope() { global $wgAutoloadLocalClasses;