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 created this task.May 22 2015, 12:13 AM
Ejegg raised the priority of this task from to Needs Triage.
Ejegg updated the task description. (Show Details)
Ejegg added a subscriber: Ejegg.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 22 2015, 12:13 AM
hashar moved this task from Untriaged to Backlog on the Continuous-Integration-Infrastructure board.
hashar added a subscriber: hashar.

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

Legoktm added a subscriber: Legoktm.Jun 2 2015, 4:55 PM

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.

Ejegg added a comment.Jun 2 2015, 4:58 PM

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.

greg added a subscriber: greg.Sep 12 2015, 6:49 AM

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.

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptDec 15 2015, 11:10 PM
Reedy added a comment.Jan 25 2016, 3:05 PM

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 claimed this task.Feb 13 2016, 2:01 PM
Krinkle triaged this task as Medium priority.
daniel added a subscriber: daniel.

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

/me wibbles in anticipation

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

HappyDog removed a subscriber: HappyDog.Feb 18 2016, 7:54 PM

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

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

Ricordisamoa closed this task as Resolved.Feb 23 2016, 2:46 AM
Ricordisamoa removed a project: Patch-For-Review.
Ricordisamoa removed a subscriber: gerritbot.
Ricordisamoa reopened this task as Open.Feb 23 2016, 2:47 AM

Oops... blocking tasks

Krinkle closed this task as Resolved.Feb 23 2016, 6:29 PM