From: Chad Horohoe Date: Sat, 12 Jul 2014 02:20:28 +0000 (-0700) Subject: Remove broken by design maintenance test X-Git-Tag: 1.31.0-rc.0~14980 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=04e9d82918b0eb19d48d31d58fef1fedeba35e69;p=lhc%2Fweb%2Fwiklou.git Remove broken by design maintenance test Any test that depends on the output of maintenance scripts is asking for failure. This test fails quite often on HHVM and is very very easy to break on single-database setups like most users have. A harmless misconfiguration of SQLite will also cause it to fail. Change-Id: Ie90284eae847accea0569745005827f1af796940 --- diff --git a/tests/phpunit/maintenance/getSlaveServerTest.php b/tests/phpunit/maintenance/getSlaveServerTest.php deleted file mode 100644 index 165dc55158..0000000000 --- a/tests/phpunit/maintenance/getSlaveServerTest.php +++ /dev/null @@ -1,68 +0,0 @@ -db->getType() === 'sqlite' ) { - // for SQLite, only the empty string is a good server name - return ''; - } - - $octet = '([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])'; - $ip = "(($octet\.){3}$octet)"; - - $label = '([a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)'; - $hostname = "($label(\.$label)*)"; - - return "($ip|$hostname)(:[0-9]{1,5})?"; - } - - function testPlain() { - $gss = new GetSlaveServer(); - $gss->execute(); - - $this->expectOutputRegex( "/^" . self::getServerRE() . "\n$/D" ); - } - - function testXmlDumpsBackupUseCase() { - global $wgDBprefix; - - global $argv; - $argv = array( null, "--globals" ); - - $gss = new GetSlaveServer(); - $gss->loadParamsAndArgs(); - $gss->execute(); - $gss->globals(); - - // The main answer - $output = $this->getActualOutput(); - $firstLineEndPos = strpos( $output, "\n" ); - if ( $firstLineEndPos === false ) { - $this->fail( "Could not find end of first line of output" ); - } - $firstLine = substr( $output, 0, $firstLineEndPos ); - $this->assertRegExp( "/^" . self::getServerRE() . "$/D", - $firstLine, "DB Server" ); - - // xmldumps-backup relies on the wgDBprefix in the output. - $this->expectOutputRegex( "/^[[:space:]]*\[wgDBprefix\][[:space:]]*=> " - . $wgDBprefix . "$/m" ); - } -}