Hi all,
Over the weekend I worked on resolving https://phabricator.wikimedia.org/T112895 ("Support installing composer require-dev packages together with mediawiki/vendor").
With the help of Bryan Davis this has now been implemented and applied to all mediawiki core and extension jobs (mediawiki-*, mwext-*).
Packages specified in mediawiki-core:/composer.json 'require-dev' section will now be fetched and installed in Jenkins, and the exposed interfaces are now available through the regular autoloader from Composer.
Key points:
* PHPUnit is now loaded from $WORKSPACE/vendor instead of the frozen legacy copy at /srv/deployment/integration/phpunit.
* PHPUnit version has not yet changed (3.7.17). However upgrading is now as easy as changing a number in MediaWiki's composer.json. And such change will also be reflected in pre-merge test jobs, so that it can be verified before merging. – See https://phabricator.wikimedia.org/T99982 and https://gerrit.wikimedia.org/r/270485
* Aside from PHPUnit, one can now also other require-dev composer packages. For example, we may want to consider using something like vfsStream for file-system mocking in PHP. – https://phabricator.wikimedia.org/T86163
-- Krinkle
Awesome, thanks Timo & Bryan!
On Tue, Feb 16, 2016 at 9:19 AM, Krinkle krinklemail@gmail.com wrote:
- PHPUnit is now loaded from $WORKSPACE/vendor instead of the frozen legacy
copy at /srv/deployment/integration/phpunit.
How does that work for mwext-testextensions? Will each extension run with its own phpunit version, or the core one?
On Tue, Feb 16, 2016 at 7:48 PM, Gergo Tisza gtisza@wikimedia.org wrote:
Awesome, thanks Timo & Bryan!
On Tue, Feb 16, 2016 at 9:19 AM, Krinkle krinklemail@gmail.com wrote:
- PHPUnit is now loaded from $WORKSPACE/vendor instead of the frozen
legacy
copy at /srv/deployment/integration/phpunit.
How does that work for mwext-testextensions? Will each extension run with its own phpunit version, or the core one?
My statement "loaded from $WORKSPACE/vendor" was an oversimplification. In actuality, it triggers a composer fetch in the MediaWiki install directory – wherever it might be for that job ($MW_INSTALL_PATH, typically workspace or workspace/src).
PHPUnit is then naturally called at runtime via the autoloader.
As before, extensions cannot override which PHPUnit version is used. However, each build does fetch its own copy based on core's composer.json - for the branch/commit of mediawiki-core used for that extensions' build (so branches work as expected, e.g. upgrading PHPUnit in master doesn't affect core or extension jobs for older release branches).
This is similar to how generic npm and composer jobs for libraries worked already. Though unlike libraries, extensions are typically not standalone projects. That's why the test entry point is in core. The extension is registered with core. And core's test entry point is invoked with parameters to skip core's test suite ("php mediawiki/tests/phpunit.php --testsuite extensions")
-- Krinkle
wikitech-l@lists.wikimedia.org