Page MenuHomePhabricator

PHPUnit runner does not load required dependencies from composer.json (SendGrid extension)
Closed, ResolvedPublic

Description

While working on PHPUnit tests for SendGrid extension (see T183572 and https://gerrit.wikimedia.org/r/#/c/404400), it was noticed that phpunit test runner does not load required dependencies specified in composer.json.

I tried looking for similar cases in other extensions tests, but couldn't find anything similar.

It was mentioned by @Addshore on IRC that

The zuul / Jenkins config / job probably needs to be changed to one that does the composer stuff :)

Any tips for best practices for such cases?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 17 2018, 4:57 PM

Change from extension-unittests-generic to extension-unittests-composer in test config (layout.yaml) to test against the extensions own composer dependency. But I have no idea, if there is a php 5.6 unittest job to do the work in this case. The current tests running 5.5.9

For WMF deployed extensions (or extensions in preparation for wmf deloyment), the dependency must be added to mediawiki/vendor after code/security review of the package to ensure that it will be installed on the cluster.

Change 404748 had a related patch set uploaded (by Phantom42; owner: Phantom42):
[integration/config@master] Use extension-unittests-composer for SendGrid extension testing

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

Change from extension-unittests-generic to extension-unittests-composer in test config (layout.yaml) to test against the extensions own composer dependency.

Thank you, @Umherirrender! Hope that solves the problem. I have just uploaded a patch regarding this: https://gerrit.wikimedia.org/r/404748

D3r1ck01 awarded a token.

As you are working on this :)

Change 404748 merged by jenkins-bot:
[integration/config@master] Use extension-unittests-composer-non-voting for SendGrid extension testing

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

D3r1ck01 closed this task as Resolved.Jan 31 2018, 6:18 AM

This fixed the issue! Thanks everyone for your help! Can we use extension-unittests-composer instead of extension-unittests-composer-non-voting now, if it works good?