r101754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101753‎ | r101754 | r101755 >
Date:00:04, 3 November 2011
Author:krinkle
Status:ok
Tags:
Comment:
[JSTesting] TestSwarmMWFetcher
* rm debug test in TestSwarmMWFetcher::getNextFollowingRevId
* implement stub TestSwarmMWFetcher::doAppendSettings

* Follows-up r101744
Modified paths:
  • /trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php (modified) (history)

Diff [purge]

Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php
@@ -212,7 +212,7 @@
213213 $this->debug( 'Checkouts dir empty? Looking up remote repo...', __METHOD__ );
214214 $next = $this->minRev;
215215 } else {
216 - $next = (int)$cur;//$this->getNextFollowingRevId( $cur );
 216+ $next = $this->getNextFollowingRevId( $cur );
217217 }
218218
219219 $this->debug( __METHOD__ . ": Going to use r{$next}" );
@@ -463,13 +463,30 @@
464464 * @param $id integer: Revision id to append settings to.
465465 */
466466 public function doAppendSettings() {
467 - $this->log( 'Appending settings... *TODO!*', __METHOD__ );
468 - return true;
 467+ $this->main->log( 'Appending settings... *TODO!*', __METHOD__ );
469468
470 - // append to mwPath/LocalSettings.php
471 - // -- contents of LocalSettings.tpl.php
472 - // -- require_once( '{$this->getPath('globalsettings')}' );"
 469+ $localSettings = "{$this->paths['mw']}/LocalSettings.php";
 470+ if ( !file_exists( $localSettings ) ) {
 471+ throw new Exception(__METHOD__ . ": LocalSettings.php missing, expected at {$localSettings}" );
 472+ }
473473
 474+ // Optional, only if existant
 475+ if ( file_exists( $this->paths['localsettingstpl'] ) ) {
 476+ // @todo
 477+ }
 478+
 479+ // Required, must exist to avoid having to do backwards editing
 480+ // Make empt file if needed
 481+ if ( !file_exists( $this->paths['globalsettings'] ) ) {
 482+ $this->main->debug( "No GlobalSettings.php found at {$this->paths['globalsettings']}. Creating...", __METHOD__ );
 483+ if ( touch( $this->paths['globalsettings'] ) ) {
 484+ $this->main->debug( "Created {$this->paths['globalsettings']}", __METHOD__ );
 485+ } else {
 486+ throw new Exception(__METHOD__ . ": Aborting. Unable to create GlobalSettings.php" );
 487+ }
 488+ }
 489+ // @todo
 490+
474491 /**
475492 * Possible additional common settings to append to LocalSettings after install:
476493 * See gerrit integration/jenkins.git:
@@ -480,5 +497,6 @@
481498 * #$wgDebugLogFile = dirname( __FILE__ ) . '/build/debug.log';
482499 * $wgDebugDumpSql = true;
483500 */
 501+ return true;
484502 }
485 -}
\ No newline at end of file
 503+}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101744[JSTesting] partial rewrite of TestSwarmMWFetcher...krinkle23:17, 2 November 2011

Status & tagging log