Page MenuHomePhabricator

Structure test to validate existence of ResourceLoaderImageModule "images" files
Closed, ResolvedPublic

Description

From T231358, 062e067d4964c2854c33821fb5522cf578dc4f89 for MinervaNeue made a ResourceLoaderImageModule invalid since it has an image pointing to a non existent file:

+                               "userSandbox": "resources/resources/skins.minerva.personalMenu.icons/userSandbox.svg"
                                                ^^^^^^^^^^^^^^^^^^^
-                               "userSandbox": "resources/skins.minerva.mainMenu.icons/userSandbox.svg"

MediaWiki has structure tests to validate resources file existence but it does not have any such tests for ResourceLoaderImageModule ones.

tests/phpunit/structure/ResourcesTest.php only look for modules being an instance of ResourceLoaderFileModule, while ResourceLoaderImageModule descend directly from ResourceLoaderModule.

We thus need an extra structure test in ResourcesTest.php to validate that images referred to by a ResourceLoaderImageModule are actually existing.

Event Timeline

zeljkofilipin triaged this task as Unbreak Now! priority.Aug 28 2019, 12:46 PM
hashar lowered the priority of this task from Unbreak Now! to Medium.Aug 28 2019, 1:19 PM

it is not a blocker but a follow up to T231358 which has been a blocker but is now solved.

Krinkle renamed this task from MediaWiki structure tests do not validate ResourceLoaderImageModule "images" file existence to Structure test to validate existence of ResourceLoaderImageModule "images" files.Sep 27 2019, 9:01 PM

Change 571615 had a related patch set uploaded (by Krinkle; owner: Holger Knust):
[mediawiki/core@master] resourceloader: Add test to validate existence of ImageModule "images" files

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

Change 571615 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Add test to validate existence of ImageModule "images" files

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

Change 576649 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/skins/MinervaNeue@master] (do not merge) ensure ImageModule images are checked

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

Change 576649 abandoned by Hashar:
(do not merge) ensure ImageModule images are checked

Reason:
It fails properly:

ResourcesTest::testImageFiles
File 'toast.mw-notification-type-error,.mw-notification.mw-notification-type-error' referenced by 'skins.minerva.content.styles.images' must exist.

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