SpecialJavaScriptTest: Bypass ResourceLoader 'target' scope
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 4 Jun 2015 20:12:23 +0000 (21:12 +0100)
committerJdlrobson <jrobson@wikimedia.org>
Tue, 4 Aug 2015 05:37:25 +0000 (05:37 +0000)
commite9b9e4df7a53cd5367252adc57abc2b2a51d7d5d
tree90681829822200dc720535a7fd5549e97a170769
parentfdb29e8d3244553fc63cd0dad8895cafed17641a
SpecialJavaScriptTest: Bypass ResourceLoader 'target' scope

To make unit testing easier, allow any module to be loaded within
the unit test suite. Regardless of the intended 'target'.

Targets are meant for restricting front-end scope in production.
Enforcing that in the test suite causes various test suites to
get de-registered at run time client-side.

Otherwise, in order to truly run all unit tests, Jenkins would
have to re-run the entire test suite in all known targets. This
wouldn't make sense because modules have to be globally uniquely
named (no conflicts) and unit tests are atomic. They can all run
in the same suite.

To prevent modules being comitted with incompatible target
dependencies, we already have a Structure test in the PHPUnit
suite to catch those issues in the module registry.

This makes the main 'qunit' build for MobileFrontend more useful,
where currently many modules aren't being tested due to them not
being in the 'desktop' target.

Bug: T103027
Change-Id: I69f735eb56c1362189298d9859d3add576faaadb
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/specials/SpecialJavaScriptTest.php