jenkins-bot has submitted this change and it was merged.

Change subject: Fix TalkpageImportOperationTest
......................................................................


Fix TalkpageImportOperationTest

- It wasn't defining the (core) tables it used. Flow storage appears to
  be mocked so we don't need those tables.
- There's an intermittent error where request context user != init user.
  Let's init with 127.0.0.1, which should be the same as the user that
  will fire the derivative request.

Bug: T86809
Change-Id: I794e9d45da2b8cdf4204dab803c8ef6869301142
---
M tests/phpunit/Import/TalkpageImportOperationTest.php
1 file changed, 18 insertions(+), 0 deletions(-)

Approvals:
  Sbisson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/Import/TalkpageImportOperationTest.php 
b/tests/phpunit/Import/TalkpageImportOperationTest.php
index 74e236b..c56e4f1 100644
--- a/tests/phpunit/Import/TalkpageImportOperationTest.php
+++ b/tests/phpunit/Import/TalkpageImportOperationTest.php
@@ -25,8 +25,26 @@
 
 /**
  * @group Flow
+ * @group Database
  */
 class TalkpageImportOperationTest extends \MediaWikiTestCase {
+       protected $tablesUsed = array(
+               // importer will ensureFlowRevision(), which will insert into 
these core tables
+               'page',
+               'revision',
+               'text',
+       );
+
+       public function setUp() {
+               parent::setUp();
+
+               // reset flow state, so everything ($container['permissions'])
+               // uses this particular $user
+               \FlowHooks::resetFlowExtension();
+               Container::reset();
+               $container = Container::getContainer();
+               $container['user'] = User::newFromName( '127.0.0.1', false );
+       }
 
        /**
         * This is a horrible test, it basically runs the whole thing

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I794e9d45da2b8cdf4204dab803c8ef6869301142
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to