Bartosz Dziewoński has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351019 )

Change subject: Add our EventLogging schemas to test module's dependencies
......................................................................

Add our EventLogging schemas to test module's dependencies

They are normally lazy-loaded, which was causing issues with
tests failing intermittently due to "Pending AJAX requests".

Bug: T164028
Change-Id: Ifc12294fc1e9d18e5ee0e9c425e55683e4f328f5
---
M UploadWizardHooks.php
1 file changed, 14 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/19/351019/1

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index d611e45..5fd4954 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -158,6 +158,19 @@
                array &$testModules,
                ResourceLoader &$resourceLoader
        ) {
+               $dependencies = [ 'ext.uploadWizard' ];
+
+               // Add our EventLogging schemas (normally lazy-loaded) to 
dependencies to avoid issues with
+               // tests failing intermittently due to "Pending AJAX requests".
+               $dependencies[] = 'ext.eventLogging';
+               $allSchemas = array_keys( 
ExtensionRegistry::getInstance()->getAttribute( 'EventLoggingSchemas' ) );
+               $ourSchemas = array_filter( $allSchemas, function ( $schema ) {
+                       return substr( $schema, 0, 12 ) === 'UploadWizard';
+               } );
+               foreach ( $ourSchemas as $schema ) {
+                       $dependencies[] = "schema.$schema";
+               }
+
                $testModules['qunit']['ext.uploadWizard.unit.tests'] = [
                        'scripts' => [
                                
'tests/qunit/controller/uw.controller.Deed.test.js',
@@ -175,9 +188,7 @@
                                'tests/qunit/uw.TitleDetailsWidget.test.js',
                                'tests/qunit/mw.fileApi.test.js',
                        ],
-                       'dependencies' => [
-                               'ext.uploadWizard',
-                       ],
+                       'dependencies' => $dependencies,
                        'localBasePath' => __DIR__,
                        'remoteExtPath' => 'UploadWizard',
                ];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc12294fc1e9d18e5ee0e9c425e55683e4f328f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

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

Reply via email to