[go: up one dir, main page]

Page MenuHomePhabricator

Unit tests without database group can still have access to the database
Closed, DuplicatePublic

Description

The ArticleViewTest.php test is storing revisions by calling saveRevision but is is not declared to be part of the @group Database to be run with database setup.

In my opinion since https://gerrit.wikimedia.org/r/c/mediawiki/core/+/289369 the database is setup and reset for every test run and no longer for tests with @group Database or $this->tablesUsed.

When trying to fix this issue I have found many tests accessing a database function.
Patch Set is https://gerrit.wikimedia.org/r/c/mediawiki/core/+/618757 - this can also break extensions and it seems that not all tests are expected to run with database.
One big issue is the use of TestUserRegistry where the user is always stored in the database.

In my opinion it is not possible to just disable the database services, because all services depending on it would than not be useable and the unit tests are not fully mocked to allow that.

Please have a look if this is a feature. I am not sure to have a good overview about test classes and cannot see the impact. Thanks.