Page MenuHomePhabricator

Set up phpunit structure tests for MediaWiki skin repositories
Closed, ResolvedPublic

Description

All six (except for Example) are currently deployed and really should have basic jobs.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:28 AM
bzimport set Reference to bz66926.
bzimport added a subscriber: Unknown Object (MLST).

Beside the usual jslint/phplint jobs, I am wondering whether we should run qunit jobs with the skin set. Though I think we only ran the qunit job against the default skin.

The tutorial for MediaWiki extensions should be more or less valid for skins : https://www.mediawiki.org/wiki/Continuous_integration/Tutorials/Adding_a_MediaWiki_extension

I have no clue what should be tested so this is on hold until someone figure out the testing strategy to be applied on mediawiki/skins/*

(In reply to Antoine "hashar" Musso from comment #2)

I have no clue what should be tested so this is on hold until someone figure
out the testing strategy to be applied on mediawiki/skins/*

For now just basic lint checks, so php -l, jslint, and I believe we have a test that checks for validity of .less files?

Yeah. There's no reason why a skin couldn't have unit tests or browser tests, but as far as I know none does right now.

Maybe we can run the qunit tests as well? Not sure whether they are passing though.

They should be, but some code (too tightly integrated with page HTML, like mw.util.addPortletLink) is known not to work with all skins. Not sure if the tests for this and other things will work correctly, but it would be nice to try.

Change 148130 had a related patch set uploaded by Hashar:
php lint jobs for MediaWiki skins

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

Change 148136 had a related patch set uploaded by Hashar:
phplint jobs for MediaWiki skins

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

Change 148136 merged by jenkins-bot:
phplint jobs for MediaWiki skins

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

Change 148130 merged by jenkins-bot:
phplint jobs for MediaWiki skins

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

I have configured Jenkins and Zuul to trigger a phplint job. The configuration and tests jobs are sharing the same Change-Id: I3ced08099f7283f75f61c170c291f7a80ee79a5b

We still want to add:

  • jshint jobs, the skins will have to pass it
  • run the MediaWiki tests that do some generic checks such as ensuring resource loader modules are properly registered

Ideally qunit tests :-)

mediawiki/skins/Vector also needs jobs.

Change 153578 had a related patch set uploaded by Addshore:
Add phplint jobs for 2 skins that were missed

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

Change 153579 had a related patch set uploaded by Addshore:
Add 2 zuul triggers for skins missing them

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

Change 153578 merged by jenkins-bot:
Add jobs for 2 skins that were missing

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

Change 153579 merged by jenkins-bot:
Add 2 zuul triggers for skins missing them

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

Thanks guys.

Can/Should this be closed now? It seems that all skin repos that have something worth testing in them are now being tested. I suggest tracking more interesting things like QUnit jobs in separate bug(s).

The skins must now have a bunch of MediaWiki core tests run on them, just like extensions. Ie the tests under /tests/phpunit/structure/ (which are the PHPUnit 'structure' test suite) and /tests/phpunit/LessTestSuite.php.

Krinkle set Security to None.
Krinkle removed a subscriber: Unknown Object (MLST).

Should this be closed since they run jobs now.

Legoktm renamed this task from Add jenkins jobs for mediawiki/skins/CologneBlue, Nostalgia, Modern, Example, MonoBook, Vector to Set up phpunit structure tests for MediaWiki skin repositories.Jun 27 2015, 3:54 AM

Should this be closed since they run jobs now.

There is only linting jobs, no actual test have been setup. See my previous comments:

run the MediaWiki tests that do some generic checks such as ensuring resource loader modules are properly registered

The skins must now have a bunch of MediaWiki core tests run on them, just like extensions. Ie the tests under /tests/phpunit/structure/ (which are the PHPUnit 'structure' test suite) and /tests/phpunit/LessTestSuite.php.

Change 228470 had a related patch set uploaded (by Hashar):
Allow skins to also be tested like extensions can

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

Change 233694 had a related patch set uploaded (by Hashar):
tests: add structure and less tests to 'skins' suite

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

Jdlrobson subscribed.

Seems like remaining tasks are related to zuul config. Please re-add projects and point me at Vector/Monobook patches if I've missed something.

Change 233694 merged by jenkins-bot:
tests: add structure and less tests to 'skins' suite

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

Change 291925 had a related patch set uploaded (by Paladox):
Disable testStyleMedia test for skins only

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

Change 291925 abandoned by Paladox:
Disable testStyleMedia test for skins only

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

Change 323161 had a related patch set uploaded (by Hashar):
Run MediaWiki 'skins' testsuite on all skins

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

Change 323161 merged by jenkins-bot:
Run MediaWiki 'skins' testsuite on all skins

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

We now have https://integration.wikimedia.org/ci/job/mw-testskin/ and https://integration.wikimedia.org/ci/job/mw-testskin-non-voting/ that clone mediawiki/core and use composer to install dependencies. The skin is then added and tests are run.

The non-voting job has been added to all skins currently configured in CI. Will see whether it is working properly and we can start making the job voting (just replace with the voting version of the job).

Change 323243 had a related patch set uploaded (by Hashar):
Add MediaWiki testsuite to a few missed skins

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

Change 323243 merged by jenkins-bot:
Add MediaWiki testsuite to a few missed skins

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

Change 323247 had a related patch set uploaded (by Hashar):
Make skin tests to vote when they are passing

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

Change 323247 merged by jenkins-bot:
Make skin tests to vote when they are passing

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

The CI part is complete. Skins not passing the structure tests have the job triggered albeit it is non voting. They will be addressed via T113860.

@Legoktm sorry it took 2 years + to get that one addressed :(

@hashar we need to add support for skin dependacies including supporting skins depending on extensions and skins please?

On eknown skin is the BlueSpiceSkin which requires the BlueSpiceFoundation extension.

Change 228470 abandoned by Paladox:
Enable zuul/jenkins to run unit tests in skin projects

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