[go: up one dir, main page]

Page MenuHomePhabricator

Handle dependency on phpspec/prophecy
Closed, ResolvedPublic5 Estimated Story Points

Description

In Wikibase and WikibaseLexeme we are using TestCase::prophesize() from phpspec/prophecy. This used to come automatically with PHPUnit. However with PHPUnit patch release 8.5.29, its dependency phpspec/prophecy was dropped, breaking backward compatibility. This caused the UBN T315892: PHPUnit\Framework\Exception: This test uses TestCase::prophesize(), but phpspec/prophecy is not installed.. This was mitigated by pinning PHPUnit to 8.25.28 for now.

We need to figure out how to enable us to upgrade PHPUnit properly again.

Possible ways forward:

  • adding phpspec/prophecy as a proper MediaWiki core require-dev composer dependency
  • reworking our tests to no longer use that prophecy functionality
  • ?

Acceptance Criteria:

  • We are able to unpin and update PHPUnit to a version above 8.25.28 without causing CI breaks

Open Questions:

  • Is this prophecy functionality actually good and maintainable and we want to use it, or is it something we would like to get rid of?

Details

SubjectRepoBranchLines +/-
mediawiki/extensions/WikibaseREL1_39+14 -8
mediawiki/extensions/WikibaseREL1_39+18 -15
mediawiki/extensions/WikibaseREL1_39+28 -30
mediawiki/extensions/WikibaseREL1_39+1 -1
mediawiki/extensions/WikibaseREL1_39+13 -10
mediawiki/extensions/WikibaseREL1_39+175 -155
mediawiki/extensions/WikibaseREL1_39+73 -64
mediawiki/extensions/WikibaseREL1_39+27 -32
mediawiki/extensions/WikibaseLexemeREL1_39+44 -48
mediawiki/extensions/WikibaseREL1_39+45 -52
mediawiki/extensions/Wikibasemaster+28 -30
mediawiki/extensions/Wikibasemaster+14 -8
mediawiki/extensions/Wikibasemaster+1 -1
mediawiki/extensions/Wikibasemaster+45 -52
mediawiki/extensions/Wikibasemaster+18 -15
mediawiki/extensions/Wikibasemaster+13 -10
mediawiki/extensions/Wikibasemaster+175 -155
mediawiki/extensions/WikibaseLexememaster+44 -48
mediawiki/extensions/Wikibasemaster+27 -32
mediawiki/extensions/Wikibasemaster+73 -64
Show related patches Customize query in gerrit

Event Timeline

Removing its usage seems like a reasonable way forward, IMHO, based on the low usage across repos and the commentary in https://github.com/sebastianbergmann/phpunit/issues/5033.

ItamarWMDE renamed this task from Figure out what to do with phpspec/prophecy to Handle dependency on phpspec/prophecy.Aug 23 2022, 10:59 AM
ItamarWMDE updated the task description. (Show Details)
ItamarWMDE subscribed.

Prio Notes:

  • Does not affect end users
  • Might affect external stakeholders (breaking change caused a UBN)
  • Affects development efforts (we cannot update our dependencies without resolving this)
  • Does not affect onboarding efforts

I also vote for getting rid of prophesize(). At a glance, it doesn’t look like we use it for anything that createMock() or getMockBuilder() can’t do – as far as I’m aware, it’s just an older way of doing the same job.

Change 831123 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in ItemPropertyIdHtmlLinkFormatterTest

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

I tried converting one class to see if there would be any issues, and it mostly went smoothly, but there are a few differences. See the commit message of the above change for details.

(I still think we can get rid of prophesize() without too much trouble, though.)

Change 831123 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in ItemPropertyIdHtmlLinkFormatterTest

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

Change 832274 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikiPageEntityRevisionLookupTest

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

Change 832275 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] Stop using prophecy in tests

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

Change 832496 had a related patch set uploaded (by Guergana Tzatchkova; author: Guergana Tzatchkova):

[mediawiki/extensions/Wikibase@master] Remove instances of prophecy library in Wikibase

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

Change 832274 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikiPageEntityRevisionLookupTest

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

Change 832275 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Stop using prophecy in tests

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

Change 833737 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikiPageEntityStoreTest

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

Change 832496 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove instances of prophecy library in Wikibase

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

Change 833739 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in TypeDispatchingWikiPageEntityMetaDataAccessorTest

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

Change 833744 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryUnitTest

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

Change 833748 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryDbTest

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

Change 833749 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikibaseValueFormatterBuildersTest

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

Change 833750 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@master] Stop using prophecy in SidebarLinkBadgeDisplayTest

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

Change 833737 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikiPageEntityStoreTest

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

Change 833744 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryUnitTest

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

Change 833748 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryDbTest

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

Change 833749 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in WikibaseValueFormatterBuildersTest

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

Change 833750 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in SidebarLinkBadgeDisplayTest

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

Change 833739 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Stop using prophecy in TypeDispatchingWikiPageEntityMetaDataAccessorTest

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

\o/ Merged patches look great, running codesearch on our repos for "prophesize" yields no results: Good Job!

Change 954237 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@REL1_39] Stop using prophecy in tests

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

Change 954238 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryUnitTest

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

Change 954238 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryUnitTest

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

Change 954237 merged by Reedy:

[mediawiki/extensions/WikibaseLexeme@REL1_39] Stop using prophecy in tests

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

Change 953500 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in ItemPropertyIdHtmlLinkFormatterTest

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

Change 953501 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikiPageEntityRevisionLookupTest

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

Change 953502 had a related patch set uploaded (by Reedy; author: Guergana Tzatchkova):

[mediawiki/extensions/Wikibase@REL1_39] Remove instances of prophecy library in Wikibase

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

Change 953503 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikiPageEntityStoreTest

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

Change 953504 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in TypeDispatchingWikiPageEntityMetaDataAccessorTest

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

Change 953505 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryDbTest

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

Change 954366 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikibaseValueFormatterBuildersTest

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

Change 954367 had a related patch set uploaded (by Reedy; author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in SidebarLinkBadgeDisplayTest

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

Change 953500 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in ItemPropertyIdHtmlLinkFormatterTest

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

Change 953501 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikiPageEntityRevisionLookupTest

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

Change 953502 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Remove instances of prophecy library in Wikibase

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

Change 953503 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikiPageEntityStoreTest

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

Change 953504 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in TypeDispatchingWikiPageEntityMetaDataAccessorTest

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

Change 953505 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in EntityIdLocalPartPageTableEntityQueryDbTest

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

Change 954366 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in WikibaseValueFormatterBuildersTest

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

Change 954367 merged by Reedy:

[mediawiki/extensions/Wikibase@REL1_39] Stop using prophecy in SidebarLinkBadgeDisplayTest

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