Page MenuHomePhabricator

Stop using the MediaWikiPHPUnitTest::startTest hook in Wikibase
Closed, ResolvedPublic

Description

The hook is going to be deprecated due to the increasing difficulty of customizing PHPUnit (see T243600 and r673705). Wikibase has:

public static function onMediaWikiPHPUnitTestStartTest( $test ) {
	WikibaseRepo::resetClassStatics();
}

which needs to go away. I don't have a suggested replacement for that.

Event Timeline

Addshore added a subscriber: Addshore.

Indeed, it sounds like we would be able to get rid of the usage of this hook once we finish the service migration

Agreed. In fact I suggest we try removing it right now, maybe we’ve already migrated all the services that needed it :)

Change 673984 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Remove MediaWikiPHPUnitTest::startTest hook handler

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

Nope, too early :D

12:11:10 Tests: 4319, Assertions: 14540, Errors: 63, Failures: 14, Skipped: 276.

But let’s revisit this towards the end of the service migration.

Nope, too early :D

12:11:10 Tests: 4319, Assertions: 14540, Errors: 63, Failures: 14, Skipped: 276.

But let’s revisit this towards the end of the service migration.

What about adding a trait which calls WikibaseRepo::resetClassStatics() in tearDownAfterClass? The problem is to figure out which test classes need it, I guess.

Nope, too early :D

12:11:10 Tests: 4319, Assertions: 14540, Errors: 63, Failures: 14, Skipped: 276.

But let’s revisit this towards the end of the service migration.

Now it works :)

Change 673984 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Remove MediaWikiPHPUnitTest::startTest hook handler

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