r79114 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79113‎ | r79114 | r79115 >
Date:18:10, 28 December 2010
Author:soxred93
Status:resolved (Comments)
Tags:
Comment:
Followup to r79109: Use a clean DB by default for each test
Modified paths:
  • /trunk/phase3/tests/phpunit/bootstrap.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/bootstrap.php
@@ -72,7 +72,7 @@
7373 }
7474 }
7575
76 - function needsDB() { return false; }
 76+ function needsDB() { return true; }
7777
7878 function addDBData() {}
7979

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79109It's here! It's finally here! The skies are falling, pigs have sprouted wings...soxred9317:15, 28 December 2010

Comments

#Comment by 😂 (talk | contribs)   22:05, 28 December 2010

Shouldn't the default be for a test to not use the DB at all? Like we discussed yesterday, we should disable the database entirely unless a test says it needs it.

#Comment by X! (talk | contribs)   22:08, 28 December 2010

The thing is, there's a lot of things which may use the i18n cache, etc without even intending too. It wouldn't hurt to make a clean DB on each test.

#Comment by 😂 (talk | contribs)   22:17, 28 December 2010

All caches (including i18n) should be disabled by bootstrap (unless we're doing a cache test?). Tests should be very narrowly focused, and should have to explicitly state when they want to use a DB. If you're accidentally using the DB in a code path where you don't mean to, it's probably a bug anyway.

#Comment by Platonides (talk | contribs)   22:09, 28 December 2010

The database is only used by tests in the Database group (which most of them belong to).

Status & tagging log