Page MenuHomePhabricator

phpunit: specify tablesUsed to ensure DB cleanup
Closed, InvalidPublic

Description

In tests interacting with the database (writing to it), MediaWikiTestCase can help us to clean up, but it needs tablesUsed to be specified[0] to work.
Tools can help us to find the places in question, but adding the tablesUsed and thus allowing the reset could reveal sloppy setUp of other tests, that rely on previously existing entities.

[0] most tests will only require "page" to be specified as this is expanded to cover more tables that go along with it

Event Timeline

Change 461925 had a related patch set uploaded (by Pablo Grass (WMDE); owner: Pablo Grass (WMDE)):
[mediawiki/core@master] MediaWikiTestCase: set tablesUsed when writing to DB

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

Needs a look into what changed in core test base classes and re-evaluate

Change 461925 abandoned by Pablo Grass (WMDE):
MediaWikiTestCase: set tablesUsed when writing to DB

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

Addshore subscribed.

This is a general goal in WIkibase, and I think the status is much better now than when this ticket was written