Chad has uploaded a new change for review.
https://gerrit.wikimedia.org/r/145746
Change subject: Remove broken by design maintenance test
......................................................................
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
---
D tests/phpunit/maintenance/getSlaveServerTest.php
1 file changed, 0 insertions(+), 68 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/46/145746/1
diff --git a/tests/phpunit/maintenance/getSlaveServerTest.php
b/tests/phpunit/maintenance/getSlaveServerTest.php
deleted file mode 100644
index 165dc55..0000000
--- a/tests/phpunit/maintenance/getSlaveServerTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-require_once __DIR__ . "/../../../maintenance/getSlaveServer.php";
-
-/**
- * Tests for getSlaveServer
- *
- * @group Database
- * @covers GetSlaveServer
- */
-class GetSlaveServerTest extends MediaWikiTestCase {
-
- /**
- * Yields a regular expression that matches a good DB server name
- *
- * It matches IPs or hostnames, both optionally followed by a
- * port specification
- *
- * @return string The regular expression
- */
- private function getServerRE() {
- if ( $this->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" );
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/145746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie90284eae847accea0569745005827f1af796940
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits