Page MenuHomePhabricator

maintenance/checkLess.php should be a PHPUnit test and run by extension suite
Closed, ResolvedPublic

Description

Author: jgonera

Description:
We have LESS support in core now. Since it is a language that compiles to CSS, we should have a Jenkins job verifying that all the LESS files compile without errors.

Ori suggested that the job should go over all the registered ResourceLoader modules, fetch LESS files from them and run the compiler on each of them to see if there are any errors.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=63343

Details

Reference
bz54665

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:19 AM
bzimport set Reference to bz54665.

(In reply to comment #0)

Ori suggested that the job should go over all the registered ResourceLoader
modules, fetch LESS files from them and run the compiler on each of them to
see if there are any errors.

maintenance/checkLess.php landed a couple days ago which does exactly this, so it should be relatively easy to run such a job if there's already the infrastructure to run things like phpunit tests.

We will want to make checkLess.php a PHP unit test and have it run in the main suite as well as in the extension test suite. This way the existing test job will magically check less files.

Moving to MediaWiki > Unit tests.

maintenance/checkLess.php should be slightly refactored so we can call the less checking from our PHPUnit unit tests.

That would be need to be called in the extensions test suite as well in order to check less validity for extensions.

Rephrasing summary, the checkLess.php needs to be done a class that would be callable from our PHPUnit test suite. That resulting test class should be called by the extension test suite to have Jenkins check LESS files for us.

Change 116735 had a related patch set uploaded by Phuedx:
[WIP] Add a framework to validate resources

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

Change 119055 had a related patch set uploaded by Phuedx:
Add a LESS test suite

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

Change 116735 abandoned by Phuedx:
[WIP] Add a framework to validate resources

Reason:
Superseded by Iedb8dc31e4817d8b4e40b655cf9b8fb092979e90.

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

Change 119055 merged by jenkins-bot:
Add a LESS test suite

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

Change-Id: I1a15a0d8aba05b774f072673787b712f6ba97fcd

Put LESS test back into extension suite in XML

Confirmed to verify extensions as well. I like how the maintenance/checkLess.php is now a wrapper around the PHPUnit tests.

Excellent work thank you!