Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher-run.php |
— | — | @@ -74,10 +74,12 @@ |
75 | 75 | $fetcher_conf = parse_ini_file( "/etc/testswarm/fetcher.ini", true ); |
76 | 76 | |
77 | 77 | // 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"; |
79 | 80 | chgrp( $dbFile, $fetcher_conf['TestSwarmAPI']['wwwusergroup'] ); |
80 | | -chmod( $dbFile, "0664" ); |
| 81 | +chmod( $dbFile, 0664 ); |
81 | 82 | |
| 83 | +// Submit a new job to TestSwarm |
82 | 84 | $api = new TestSwarmAPI( |
83 | 85 | $main |
84 | 86 | , $fetcher_conf['TestSwarmAPI']['username'] |
Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php |
— | — | @@ -54,6 +54,8 @@ |
55 | 55 | /** Path to log file */ |
56 | 56 | protected $logPath; |
57 | 57 | |
| 58 | + /** URL pattern for $wgScriptPath */ |
| 59 | + protected $scriptPathPattern = "/checkouts/mw/trunk/r$1"; |
58 | 60 | /** URL pattern to add one test. $1 is rev, $2 testname */ |
59 | 61 | protected $testPattern = "/checkouts/mw/trunk/r$1/tests/qunit/?filter=$2"; |
60 | 62 | |
— | — | @@ -63,8 +65,8 @@ |
64 | 66 | public function getSvnUrl() { return $this->svnUrl; } |
65 | 67 | public function getLogPath() { return $this->logPath; } |
66 | 68 | public function getTestPattern() { return $this->testPattern; } |
| 69 | + public function getScriptPathPattern() { return $this->scriptPathPattern; } |
67 | 70 | |
68 | | - |
69 | 71 | /** SETTERS **/ |
70 | 72 | |
71 | 73 | public function setLogPath( $path ) { |
— | — | @@ -105,7 +107,7 @@ |
106 | 108 | } |
107 | 109 | |
108 | 110 | if ( isset( $options['debug'] ) ) { |
109 | | - $this->debugMode = true; |
| 111 | + $this->debugMode = $options['debug']; |
110 | 112 | } |
111 | 113 | |
112 | 114 | if ( isset( $options['minRev'] ) ) { |
— | — | @@ -444,6 +446,10 @@ |
445 | 447 | // For convenience, put it in debug (not in saved log) |
446 | 448 | $this->main->debug( "Generated wikiadmin pass: {$randomAdminPass}", __METHOD__ ); |
447 | 449 | |
| 450 | + $scriptPath = str_replace( '$1', $this->svnRevId, |
| 451 | + $this->main->getScriptPathPattern() |
| 452 | + ); |
| 453 | + |
448 | 454 | // Now simply run the CLI installer: |
449 | 455 | $cmd = "php {$this->paths['mw']}/maintenance/install.php \ |
450 | 456 | --dbname=r{$this->svnRevId} \ |
— | — | @@ -452,9 +458,14 @@ |
453 | 459 | --showexceptions=true \ |
454 | 460 | --confpath={$this->paths['mw']} \ |
455 | 461 | --pass={$randomAdminPass} \ |
| 462 | + --scriptpath={$scriptPath} \ |
456 | 463 | TrunkWikiR{$this->svnRevId} \ |
457 | 464 | WikiSysop |
458 | 465 | "; |
| 466 | + $this->main->debug( |
| 467 | + "Installation command for revision '$this->svnRevId':\n" |
| 468 | + . $cmd . "\n" |
| 469 | + ); |
459 | 470 | |
460 | 471 | $retval = null; |
461 | 472 | $output = $this->main->exec( $cmd, $retval ); |
— | — | @@ -485,16 +496,25 @@ |
486 | 497 | |
487 | 498 | // Required, must exist to avoid having to do backwards editing |
488 | 499 | // 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__ ); |
493 | 505 | } else { |
494 | 506 | throw new Exception(__METHOD__ . ": Aborting. Unable to create GlobalSettings.php" ); |
495 | 507 | } |
496 | 508 | } |
497 | | - // @todo |
498 | 509 | |
| 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 | + |
499 | 519 | /** |
500 | 520 | * Possible additional common settings to append to LocalSettings after install: |
501 | 521 | * See gerrit integration/jenkins.git: |