aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/api/ApiTestCase.php
diff options
context:
space:
mode:
authorBrad Jorsch <bjorsch@wikimedia.org>2013-01-18 14:02:28 -0500
committerBrad Jorsch <bjorsch@wikimedia.org>2013-01-18 14:07:49 -0500
commit252ae6268bb33360fa2f918a264364ef3d52323c (patch)
tree5b6b558b224e94cf5dd472c71bbfbc2d5888eeda /tests/phpunit/includes/api/ApiTestCase.php
parent258929f57248879e30749ff6007e545f36623a0a (diff)
downloadmediawikicore-252ae6268bb33360fa2f918a264364ef3d52323c.tar.gz
mediawikicore-252ae6268bb33360fa2f918a264364ef3d52323c.zip
(bug 43762) Mark slow unit test as @group medium
All tests based on APITestCase can be slow. I've also seen more than one Jenkins failure due to GlobalTest::testMerge timing out. Also, added a meta-test on APITestCase to make sure that all its subclasses are marked with @group medium or @group large, to prevent new tests from re-causing the bug. Change-Id: I48630736a3d06574876fd1fa3d90899cfbc48012
Diffstat (limited to 'tests/phpunit/includes/api/ApiTestCase.php')
-rw-r--r--tests/phpunit/includes/api/ApiTestCase.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php
index 7e054a466396..fcd581abcc59 100644
--- a/tests/phpunit/includes/api/ApiTestCase.php
+++ b/tests/phpunit/includes/api/ApiTestCase.php
@@ -147,6 +147,17 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
'prop' => 'info' ), $session, false, $user->user );
return $data;
}
+
+ public function testApiTestGroup() {
+ $groups = PHPUnit_Util_Test::getGroups( get_class( $this ) );
+ $constraint = PHPUnit_Framework_Assert::logicalOr(
+ $this->contains( 'medium' ),
+ $this->contains( 'large' )
+ );
+ $this->assertThat( $groups, $constraint,
+ 'ApiTestCase::setUp can be slow, tests must be "medium" or "large"'
+ );
+ }
}
class UserWrapper {