Page MenuHomePhabricator

ContentTranslation tests for mwext-testextension-zend tests fails in wmf19 and wmf20
Closed, ResolvedPublic

Description

Tests failing:

Failing at,
09:06:41 1) ResourcesTest::testMissingDependencies
09:06:41 The module 'wikibase.client.PageConnector' required by 'ext.cx.wikibase.link' must exist
09:06:41 Failed asserting that an array contains 'wikibase.client.PageConnector'.

wmf19, wmf20 has above module in Wikibase, so I suspect something wrong with tests.

Event Timeline

Sounds very similar to T109670. Isn't the same Jenkins configuration running there?

Uhm, it looks fine to me...that's weird. Any ideas @JanZerebecki?

On the wmf branch the falling test is:

1) ResourcesTest::testMissingDependencies
The module 'wikibase.client.PageConnector' required by 'ext.cx.wikibase.link' must exist
Failed asserting that an array contains 'wikibase.client.PageConnector'.

Two things come to mind:

  1. wikibase.client.PageConnector is not yet in mediawiki/extensions/Wikidata wmf branch. Amir confirmed it has been around for quite a long time apparently. It is definitely in Wikidata wmf/1.26wmf9 branch;
  1. the wikidata extension is not properly initialized and does not register its ResourceLoader modules.

The mediawiki/extensions/Wikidata PHP entry point has:

// Jenkins stuff part1
if ( PHP_SAPI === 'cli' && strpos( getenv( 'JOB_NAME' ), 'mwext-Wikidata-testextension' ) !== false ) { 
    // in future, run as non-experimental
    if ( !defined( 'WB_EXPERIMENTAL_FEATURES' ) || !WB_EXPERIMENTAL_FEATURES ) {
        define( 'WB_EXPERIMENTAL_FEATURES', true );
    }

    $wmgUseWikibaseRepo = true;
    $wmgUseWikibaseClient = true;
}

So that is only run when the Jenkins job is mwext-Wikidata-testextension. Changes for ContentTranslation triggers mwext-testextension-zend hence the Wikidata loader code is skipped. I suspect that skips the Wikidata client resource loader registration leading to the failure.

I do not understand why it pass on the master branch though :-(

On the master branch though the Wikidata.php entry point has:

// Jenkins stuff part1
if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI == true ) {
    // in future, run as non-experimental
    if ( !defined( 'WB_EXPERIMENTAL_FEATURES' ) || !WB_EXPERIMENTAL_FEATURES ) {
        define( 'WB_EXPERIMENTAL_FEATURES', true );
    }

    $wmgUseWikibaseRepo = true;
    $wmgUseWikibaseClient = true;
    $wmgUseWikibaseQuality = true;
}

So Wikidata is always loaded on Jenkins whenever Wikidata is included. Some patch need to be backported to wmf branches.

That fix need to be backported to wmf branches:

commit 62b9e9a64f6bdf75b12f0332109f2585c1e97702
Author: WikidataBuilder <wikidata-services@wikimedia.de>
Date:   Tue Aug 18 15:11:33 2015 +0000

    New Wikidata Build - 2015-08-18T15:11:20+0000
    
    Change-Id: I554e48f10216deb673596089d6cf66640e63339e

diff --git a/Wikidata.php b/Wikidata.php
index 1179742..7aede33 100644
--- a/Wikidata.php
+++ b/Wikidata.php
@@ -4,7 +4,7 @@
 }
 
 // Jenkins stuff part1
-if ( PHP_SAPI === 'cli' && strpos( getenv( 'JOB_NAME' ), 'mwext-Wikidata-testextension' ) !== false ) {
+if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI == true ) {
        // in future, run as non-experimental
        if ( !defined( 'WB_EXPERIMENTAL_FEATURES' ) || !WB_EXPERIMENTAL_FEATURES ) {
                define( 'WB_EXPERIMENTAL_FEATURES', true );
@@ -72,7 +72,7 @@
 );
 
 // Jenkins stuff part2
-if ( PHP_SAPI === 'cli' && strpos( getenv( 'JOB_NAME' ), 'mwext-Wikidata-testextension' ) !== false ) {
+if ( isset( $wgWikimediaJenkinsCI ) && $wgWikimediaJenkinsCI == true ) {
        //Jenkins always loads both so no need to check if they are loaded before getting settings
        require_once __DIR__ . '/extensions/Wikibase/repo/ExampleSettings.php';
        require_once __DIR__ . '/extensions/Wikibase/client/ExampleSettings.php';

So https://gerrit.wikimedia.org/r/#/c/232272/ needs backport to wmf branches.

Change 234492 had a related patch set uploaded (by Aude):
Fix Wikidata.php entry point for jenkins

https://gerrit.wikimedia.org/r/234492

Change 234493 had a related patch set uploaded (by Aude):
Fix Wikidata.php entry point for jenkins

https://gerrit.wikimedia.org/r/234493

Amire80 triaged this task as High priority.

Change 234493 merged by jenkins-bot:
Fix Wikidata.php entry point for jenkins

https://gerrit.wikimedia.org/r/234493

Change 234492 abandoned by Aude:
Fix Wikidata.php entry point for jenkins

Reason:
wmf19 is no longer deployed, so we don't need this.

https://gerrit.wikimedia.org/r/234492

Change 268654 had a related patch set uploaded (by Hashar):
Fix Wikidata.php entry point for jenkins

https://gerrit.wikimedia.org/r/268654