[go: nahoru, domu]

Page MenuHomePhabricator

Move MediaWikiIntegrationTestCase setup and teardown away from run()
Closed, ResolvedPublic

Description

MediaWikiIntegrationTestCase overrides TestCase::run to do some class-level setup (and corresponding teardown). This is a huge hack and will no longer be possible in PHPUnit 10, which makes TestCase::run final. The code should really run in before(Class)/after(Class) hooks. The problem is, *Class methods would have to be static, but the current implementation uses a lot of non-static code.

Another issue with the current implementation is that it doesn't seem to work with paratest, because if an exception is thrown in the setup phase, the TestResult object will have 1 error and 0 tests, which fails an assertion in paratest.

Event Timeline

Change 939363 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Make some methods static in MediaWikiIntegrationTestCase

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

Daimona renamed this task from Move MediaWikiIntegrationTestCase class-level setup and teardown to @beforeClass and @afterClass to Move MediaWikiIntegrationTestCase setup and teardown away from run().Aug 11 2023, 8:00 PM
Daimona updated the task description. (Show Details)

Change 948181 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Make MediaWikiIntegrationTestCase::needsDB() final and static

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

Change 948185 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Do not override run() in MediaWikiIntegrationTestCase

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

Change 939363 merged by jenkins-bot:

[mediawiki/core@master] Make some methods static in MediaWikiIntegrationTestCase

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

Change 948181 merged by jenkins-bot:

[mediawiki/core@master] Make MediaWikiIntegrationTestCase::needsDB() final and static

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

Change 948191 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Make more methods static in MediaWikiIntegrationTestCase

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

Change 948185 merged by jenkins-bot:

[mediawiki/core@master] Do not override run() in MediaWikiIntegrationTestCase

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

Change 948191 merged by jenkins-bot:

[mediawiki/core@master] Make more methods static in MediaWikiIntegrationTestCase

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

Daimona removed a project: Patch-For-Review.