Daniel Kinzler has uploaded a new change for review.
https://gerrit.wikimedia.org/r/249421
Change subject: During unit tests, use a fake cache, to avoid puluting
memcached and distortign test results.
......................................................................
During unit tests, use a fake cache, to avoid puluting memcached and distortign
test results.
Change-Id: Id5ebad84818ba55d9ace5fe2b40c2588f0abd9ff
---
M client/includes/store/sql/DirectSqlStore.php
M lib/includes/modules/SitesModule.php
M repo/includes/store/sql/SqlStore.php
3 files changed, 7 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/21/249421/1
diff --git a/client/includes/store/sql/DirectSqlStore.php
b/client/includes/store/sql/DirectSqlStore.php
index de0d9fc..09f9258 100644
--- a/client/includes/store/sql/DirectSqlStore.php
+++ b/client/includes/store/sql/DirectSqlStore.php
@@ -339,7 +339,7 @@
// Lower caching layer using persistent cache (e.g. memcached).
$persistentCachingLookup = new CachingEntityRevisionLookup(
$rawLookup,
- wfGetCache( $this->cacheType ),
+ wfGetCache( defined( 'MW_PHPUNIT_TEST' ) ? CACHE_NONE :
$this->cacheType ),
$this->cacheDuration,
$cacheKeyPrefix
);
diff --git a/lib/includes/modules/SitesModule.php
b/lib/includes/modules/SitesModule.php
index 7ae14fa..0fbdb0d 100644
--- a/lib/includes/modules/SitesModule.php
+++ b/lib/includes/modules/SitesModule.php
@@ -23,10 +23,14 @@
private $worker;
public function __construct() {
+ $cacheType = defined( 'MW_PHPUNIT_TEST' )
+ ? CACHE_NONE
+ : ( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING );
+
$this->worker = new SitesModuleWorker(
Settings::singleton(),
SiteSQLStore::newInstance(),
- wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING )
+ wfGetCache( $cacheType )
);
}
diff --git a/repo/includes/store/sql/SqlStore.php
b/repo/includes/store/sql/SqlStore.php
index c2cd7be..4e0b4f2 100644
--- a/repo/includes/store/sql/SqlStore.php
+++ b/repo/includes/store/sql/SqlStore.php
@@ -397,7 +397,7 @@
// Lower caching layer using persistent cache (e.g. memcached).
$persistentCachingLookup = new CachingEntityRevisionLookup(
$rawLookup,
- wfGetCache( $this->cacheType ),
+ wfGetCache( defined( 'MW_PHPUNIT_TEST' ) ? CACHE_NONE :
$this->cacheType ),
$this->cacheDuration,
$cacheKeyPrefix
);
--
To view, visit https://gerrit.wikimedia.org/r/249421
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5ebad84818ba55d9ace5fe2b40c2588f0abd9ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits