Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/78520
Change subject: Limit when we log in for Api Tests
......................................................................
Limit when we log in for Api Tests
This cuts 50% of the run time from Api tests for me
The last time I tried this change Travis complained
Now that the test base has been refactored and
Item ids are no longer really important this
should work!
Change-Id: Ib528385c31524390af458e5c02a000839d7795a2
---
M repo/tests/phpunit/includes/api/WikibaseApiTestCase.php
1 file changed, 8 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/20/78520/1
diff --git a/repo/tests/phpunit/includes/api/WikibaseApiTestCase.php
b/repo/tests/phpunit/includes/api/WikibaseApiTestCase.php
index 76bf209..88605a9 100644
--- a/repo/tests/phpunit/includes/api/WikibaseApiTestCase.php
+++ b/repo/tests/phpunit/includes/api/WikibaseApiTestCase.php
@@ -53,22 +53,11 @@
protected static $loginUser = null;
protected static $token = null;
- protected $setUpComplete = false;
-
- protected function isSetUp() {
- return $this->setUpComplete;
- }
-
public function setUp() {
global $wgUser;
parent::setUp();
- static $hasSites = false;
-
- if ( !$hasSites ) {
- \TestSites::insertIntoDb();
- $hasSites = true;
- }
+ static $isSetup = false;
self::$usepost = Settings::get( 'apiInDebug' ) ? Settings::get(
'apiDebugWithPost' ) : true;
self::$usetoken = Settings::get( 'apiInDebug' ) ?
Settings::get( 'apiDebugWithTokens' ) : true;
@@ -83,13 +72,17 @@
$wgUser = self::$users['wbeditor']->user;
- $this->login();
+ if ( !$isSetup ) {
+ \TestSites::insertIntoDb();
+
+ $this->login();
+
+ $isSetup = true;
+ }
//TODO: preserve session and token between calls?!
self::$loginSession = false;
self::$token = false;
-
- $this->setUpComplete = true;
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/78520
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib528385c31524390af458e5c02a000839d7795a2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits