r106643 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106642‎ | r106643 | r106644 >
Date:11:40, 19 December 2011
Author:hashar
Status:ok
Tags:ci 
Comment:
merge from git

8f808bc - wgServer is now always autodetected (8 minutes ago) <Antoine Mu
5bc15b9 - installer now set wgScriptPath (19 minutes ago) <Antoine Musso>
0b50b1e - php chmod need octal, not a string! (52 minutes ago) <Antoine Musso>
0b2c572 - fix DB paths (59 minutes ago) <Antoine Musso>
d501814 - debug mode was always enabled! (61 minutes ago) <Antoine Musso>
6cefbbf - allow apache to write SQLite databases (14 hours ago) <Antoine Musso>
Modified paths:
  • /trunk/tools/testswarm/scripts/testswarm-mw-fetcher-run.php (modified) (history)
  • /trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php (modified) (history)

Diff [purge]

Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher-run.php
@@ -74,10 +74,12 @@
7575 $fetcher_conf = parse_ini_file( "/etc/testswarm/fetcher.ini", true );
7676
7777 // Fix up database file permission
78 -$dbFile = "{$main->fetcher->paths['db']}/r{$rev}.sqlite";
 78+$paths = $main->getPathsForRev( $rev );
 79+$dbFile = $paths['db'] . "/r{$rev}.sqlite";
7980 chgrp( $dbFile, $fetcher_conf['TestSwarmAPI']['wwwusergroup'] );
80 -chmod( $dbFile, "0664" );
 81+chmod( $dbFile, 0664 );
8182
 83+// Submit a new job to TestSwarm
8284 $api = new TestSwarmAPI(
8385 $main
8486 , $fetcher_conf['TestSwarmAPI']['username']
Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php
@@ -54,6 +54,8 @@
5555 /** Path to log file */
5656 protected $logPath;
5757
 58+ /** URL pattern for $wgScriptPath */
 59+ protected $scriptPathPattern = "/checkouts/mw/trunk/r$1";
5860 /** URL pattern to add one test. $1 is rev, $2 testname */
5961 protected $testPattern = "/checkouts/mw/trunk/r$1/tests/qunit/?filter=$2";
6062
@@ -63,8 +65,8 @@
6466 public function getSvnUrl() { return $this->svnUrl; }
6567 public function getLogPath() { return $this->logPath; }
6668 public function getTestPattern() { return $this->testPattern; }
 69+ public function getScriptPathPattern() { return $this->scriptPathPattern; }
6770
68 -
6971 /** SETTERS **/
7072
7173 public function setLogPath( $path ) {
@@ -105,7 +107,7 @@
106108 }
107109
108110 if ( isset( $options['debug'] ) ) {
109 - $this->debugMode = true;
 111+ $this->debugMode = $options['debug'];
110112 }
111113
112114 if ( isset( $options['minRev'] ) ) {
@@ -444,6 +446,10 @@
445447 // For convenience, put it in debug (not in saved log)
446448 $this->main->debug( "Generated wikiadmin pass: {$randomAdminPass}", __METHOD__ );
447449
 450+ $scriptPath = str_replace( '$1', $this->svnRevId,
 451+ $this->main->getScriptPathPattern()
 452+ );
 453+
448454 // Now simply run the CLI installer:
449455 $cmd = "php {$this->paths['mw']}/maintenance/install.php \
450456 --dbname=r{$this->svnRevId} \
@@ -452,9 +458,14 @@
453459 --showexceptions=true \
454460 --confpath={$this->paths['mw']} \
455461 --pass={$randomAdminPass} \
 462+ --scriptpath={$scriptPath} \
456463 TrunkWikiR{$this->svnRevId} \
457464 WikiSysop
458465 ";
 466+ $this->main->debug(
 467+ "Installation command for revision '$this->svnRevId':\n"
 468+ . $cmd . "\n"
 469+ );
459470
460471 $retval = null;
461472 $output = $this->main->exec( $cmd, $retval );
@@ -485,16 +496,25 @@
486497
487498 // Required, must exist to avoid having to do backwards editing
488499 // Make empt file if needed
489 - if ( !file_exists( $this->paths['globalsettings'] ) ) {
490 - $this->main->debug( "No GlobalSettings.php found at {$this->paths['globalsettings']}. Creating...", __METHOD__ );
491 - if ( touch( $this->paths['globalsettings'] ) ) {
492 - $this->main->debug( "Created {$this->paths['globalsettings']}", __METHOD__ );
 500+ $globalSettings = $this->paths['globalsettings'];
 501+ if ( !file_exists( $globalSettings ) ) {
 502+ $this->main->debug( "No GlobalSettings.php found at $globalSettings. Creating...", __METHOD__ );
 503+ if ( touch( $globalSettings ) ) {
 504+ $this->main->debug( "Created $globalSettings", __METHOD__ );
493505 } else {
494506 throw new Exception(__METHOD__ . ": Aborting. Unable to create GlobalSettings.php" );
495507 }
496508 }
497 - // @todo
498509
 510+ // Override $wgServer set by the CLI installer and rely on the default autodetection
 511+ $fh = fopen( $localSettings, 'a' );
 512+ fwrite( $fh,
 513+ "\n# /Added by testswarm fetcher/\n"
 514+ .'$wgServer = WebRequest::detectServer();'."\n"
 515+ ."\n#End /Added by testswarm fetcher/\n"
 516+ );
 517+ fclose( $fh );
 518+
499519 /**
500520 * Possible additional common settings to append to LocalSettings after install:
501521 * See gerrit integration/jenkins.git:

Status & tagging log