Awight has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404474 )

Change subject: Minor test clean up
......................................................................

Minor test clean up

Change-Id: I95882a35ceb69d8266c5797d35f466db5f309e88
---
M tests/phpunit/maintenance/PurgeScoreCacheTest.php
1 file changed, 4 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ORES 
refs/changes/74/404474/1

diff --git a/tests/phpunit/maintenance/PurgeScoreCacheTest.php 
b/tests/phpunit/maintenance/PurgeScoreCacheTest.php
index 9209716..3dafa78 100644
--- a/tests/phpunit/maintenance/PurgeScoreCacheTest.php
+++ b/tests/phpunit/maintenance/PurgeScoreCacheTest.php
@@ -37,12 +37,15 @@
                $this->maintenance = new PurgeScoreCache();
 
                TestHelper::clearOresTables();
+               TestHelper::insertModelData();
 
                // Reset service to purge cached models.
                MediaWikiServices::getInstance()->resetServiceForTesting( 
'ORESModelLookup' );
        }
 
-       public function testPurgeScoreCache_noop() {
+       public function testPurgeScoreCache_emptyDb() {
+               TestHelper::clearOresTables();
+
                // FIXME: Shouldn't be necessary once we capture output.
                $this->maintenance->loadWithArgv( [ '--quiet' ] );
 
@@ -55,7 +58,6 @@
 
        public function testPurgeScoreCache_bad_model() {
                $revId = mt_rand( 1000, 9999 );
-               TestHelper::insertModelData();
                TestHelper::insertOresData( $revId, [
                        'damaging' => 0.1,
                ] );
@@ -81,7 +83,6 @@
 
        public function testPurgeScoreCache_all() {
                $revId = mt_rand( 1000, 9999 );
-               TestHelper::insertModelData();
                TestHelper::insertOresData( $revId, [
                        TestHelper::DAMAGING_OLD => 0.2,
                        'damaging' => 0.1,
@@ -103,7 +104,6 @@
 
        public function testPurgeScoreCache_oldModels() {
                $revId = mt_rand( 1000, 9999 );
-               TestHelper::insertModelData();
                TestHelper::insertOresData( $revId, [
                        TestHelper::DAMAGING_OLD => 0.2,
                        'damaging' => 0.1,
@@ -134,7 +134,6 @@
                $revId = mt_rand( 1000, 9999 );
                $revIdOld = $revId - 1;
 
-               TestHelper::insertModelData();
                TestHelper::insertOresData( $revId, [
                        'damaging' => 0.1,
                ] );
@@ -167,7 +166,6 @@
 
        public function testPurgeScoreCache_oneModel() {
                $revId = mt_rand( 1000, 9999 );
-               TestHelper::insertModelData();
                TestHelper::insertOresData( $revId, [
                        'damaging' => 0.1,
                        'reverted' => 0.3,

-- 
To view, visit https://gerrit.wikimedia.org/r/404474
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I95882a35ceb69d8266c5797d35f466db5f309e88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ORES
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to