Page MenuHomePhabricator

Upgrade PHPUnit to 4.0+
Closed, ResolvedPublic

Description

It will be great when we can use the 4.0+ features, like setting return values for mocked methods and expecting specific calls.

Event Timeline

Ejegg raised the priority of this task from to Needs Triage.
Ejegg updated the task description. (Show Details)
Ejegg subscribed.
hashar moved this task from Untriaged to Backlog on the Continuous-Integration-Infrastructure board.
hashar subscribed.

The Jenkins job currently uses a stalled version of PHPUnit 3.7.x provided via a git repository. We will never update it. Instead the jobs will be using composer to bring in PHPUnit: T90303

Which repository is this for? If it's a MediaWiki extension it's blocked on T90303, but if it is something standalone, we can convert it to a composer test entry point with its own phpunit version.

I was asking in regards to the DonationInterface extension. For now, I found a handy @requires annotation that lets me run the newfangled tests locally without failing on older versions of PHPUnit.

So the first step to be able to use a newer PHPUnit version with extensions is to make core compatible with a newer PHPUnit version and add that newer version to core its composer.json . As long as it is also compatible with the old PHPUnit version it is not necessary to first solve the blocker T90303: Fetch dependencies using composer instead of cloning mediawiki/vendor for non-wmf branches. There are jobs for phpunit that have T90303 solved, but they are currently not used in the gate or test pipeline only in the experimental one. But those jobs still use the system wide PHPUnit. To be able to run a job with a PHPUnit installed via composer I created T112867.

Change 266060 abandoned by Hashar:
Update phpunit to 4.8.21

Reason:
The Jenkins jobs are using 3.7 provided via integration/phpunit which we do not want to bump/maintain See past attempts https://gerrit.wikimedia.org/r/#/q/project:integration/phpunit,n,z . Merely because the version is shared among all MediaWiki release we maintain and some old ones are not supporting PHPUnit 4.x.

Please see T99982 "Upgrade PHPUnit to 4.0 " to bump it up. It is basically blocked on being able to run it via composer.

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

Can we not like have files on disk? Name them sensibly, stage them (whether through puppet etc), and then use the version that composer suggests, rather than pulling it via composer?

, and then use the version that composer suggests, rather than pulling it via composer?

I think that would be more work, make it more complicated and be more fragile. What is the problem with pulling it via composer?

Change 270485 had a related patch set uploaded (by Krinkle):
[WIP] Upgrade from PHPunit 3.7.x to PHPUnit 4.8.x

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

Krinkle triaged this task as Medium priority.

Change 270504 had a related patch set uploaded (by Krinkle):
mw-phpunit: Remove spurious --conf parameter to phpunit

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

Change 270504 merged by jenkins-bot:
mw-phpunit: Remove spurious --conf parameter to phpunit

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

Change 270513 had a related patch set uploaded (by Paladox):
Use mediawiki path for the phpunit

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

Change 270515 had a related patch set uploaded (by Krinkle):
mw-phpunit: Remove default value for PHPUNIT_DIR

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

Change 270513 abandoned by Krinkle:
Use mediawiki path for the phpunit

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

Change 270545 had a related patch set uploaded (by Krinkle):
mediawiki-core-code-coverage: Remove hardcoded phpunit-dir

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

Change 270515 merged by jenkins-bot:
Remove default PHPUNIT_DIR mw-phpunit.sh and mw-run-phpunit-allexts.sh

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

Change 270545 merged by jenkins-bot:
mediawiki-core-code-coverage: Remove hardcoded phpunit-dir

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

Change 270485 merged by jenkins-bot:
Upgrade from PHPunit 3.7.x to PHPUnit 4.8.x

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

Ricordisamoa removed a project: Patch-For-Review.
Ricordisamoa removed a subscriber: gerritbot.

Oops... blocking tasks