r89302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89301‎ | r89302 | r89303 >
Date:22:54, 1 June 2011
Author:demon
Status:reverted
Tags:
Comment:
Exclude Block tests until somebody fixes them, also cache listTables() result so we can skip some queries
Modified paths:
  • /trunk/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/BlockTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -12,6 +12,7 @@
1313 protected $oldTablePrefix;
1414 protected $useTemporaryTables = true;
1515 private static $dbSetup = false;
 16+ private static $dbTables = null;
1617
1718 /**
1819 * Table name prefixes. Oracle likes it shorter.
@@ -191,18 +192,21 @@
192193 protected function listTables() {
193194 global $wgDBprefix;
194195
195 - $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
196 - $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
 196+ if( is_null( self::$dbTables ) ) {
 197+ $tables = $this->db->listTables( $wgDBprefix, __METHOD__ );
 198+ $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables );
197199
198 - if ( $this->db->getType() == 'sqlite' ) {
199 - $tables = array_flip( $tables );
200 - // these are subtables of searchindex and don't need to be duped/dropped separately
201 - unset( $tables['searchindex_content'] );
202 - unset( $tables['searchindex_segdir'] );
203 - unset( $tables['searchindex_segments'] );
204 - $tables = array_flip( $tables );
 200+ if ( $this->db->getType() == 'sqlite' ) {
 201+ $tables = array_flip( $tables );
 202+ // these are subtables of searchindex and don't need to be duped/dropped separately
 203+ unset( $tables['searchindex_content'] );
 204+ unset( $tables['searchindex_segdir'] );
 205+ unset( $tables['searchindex_segments'] );
 206+ $tables = array_flip( $tables );
 207+ }
 208+ self::$dbTables = $tables;
205209 }
206 - return $tables;
 210+ return self::$dbTables;
207211
208212 }
209213
Index: trunk/phase3/tests/phpunit/includes/BlockTest.php
@@ -2,6 +2,7 @@
33
44 /**
55 * @group Database
 6+ * @group Broken
67 */
78 class BlockTest extends MediaWikiLangTestCase {
89

Follow-up revisions

RevisionCommit summaryAuthorDate
r89303Mostly revert r89302, was slower than the originaldemon23:17, 1 June 2011

Status & tagging log