Page MenuHomePhabricator

test WikidataPageBanner its integration with Wikibase
Open, LowPublic

Description

Test cases exercising the code lines calling into Wikidata related code need to be written


Configuration in CI was done, so the below is historic.

Given that the internals of Wikidata cannot be guaranteed to be stable we should make sure that the integration of WikidataPageBanner with it is tested and that the these are run by the CI. This requires that at least one job is run with Wikibase available.

One can add Wikidata as a dependency of WikidataPageBanner to its test job in integration/config.git/zuul/ext_dependencies.py . Then to run those tests before deployment T96264 needs to be done and WikidataPageBanner also needs to be added to the mediawiki-extensions-hhvm job.

An alternative implementation that only uses interfaces that have stability guarantees is outlined in T106773: use wikibase composer managed libraries together with the API.

Details

Related Gerrit Patches:

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task to June 26-July 18 on the Wikidata-Page-Banner board.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2015, 12:44 AM
JanZerebecki renamed this task from WikidataPageBanner tests should be run by Wikibase to WikidataPageBanner tests should run with Wikibase.Jul 24 2015, 2:04 PM
JanZerebecki updated the task description. (Show Details)
JanZerebecki edited projects, added Continuous-Integration-Config; removed Jenkins.
JanZerebecki set Security to None.

@JanZerebecki @hashar could you help me get this setup? I'm not to familiar with how this stuff works.

Sure. What is your question? Which part of this task are you trying to tackle and at what steps are you trying?

The problem I'm seeing is there is no entry for Wikidata in integration/config.git/zuul/ext_dependencies.py and I always get confused about the differences between WikibaseClient/Lib/View

I feel like it is more complicated then adding
'Wikibase': ['WikidataPageBanner']
to ext_dependencies.py
or is it really that easy?

(note: I don't have much experience with setting up QA infrastructure)

To have the code you are using around when Jenkins runs the WikidataPageBanner tests, adding 'WikidataPageBanner': ['Wikidata'] is just that easy for the jobs that are relevant here and are used by WikidataPageBanner: mwext-testextension-hhvm, mwext-testextension-zend, mwext-qunit.

Why do you want to declare that Wikibase depends on WikidataPageBanner?

Did you consider using Wikidata through its Mediawiki API instead? (Those are intended for others to use. What WikidataPageBanner uses right now is a private interface.) That would sidestep the whole issue.

JanZerebecki renamed this task from WikidataPageBanner tests should run with Wikibase to test WikidataPageBanner its integration with Wikibase.Aug 10 2015, 4:35 PM
JanZerebecki updated the task description. (Show Details)

I don't really agree this is a blocker, given this feature has to be turned on via a feature flag. It could be a blocker for enabling that feature flag but given this is running on the beta cluster now we will certainly be finding serious bugs before they hit production.

greg added a subscriber: greg.Aug 10 2015, 6:31 PM

Right, this blocks production deploy, not Beta Cluster.

Let me try again.. :)
The Wikidata integration must be turned on explicitly via a global config variable which is off by default so I'm suggesting this /doesn't/ block a production deploy. The extension has a soft dependency on Wikidata.

I'll get to this next week. The wikidata part of the extension is a soft dependency and we are not turning it on just yet.

API is definitely something we could explore - but doesn't that internally run an API request and I'm not sure if that would scale?

I think this is enough provided Wikibase follows normal deprecation procedures (it's worth noting MobileFrontend uses the Wikibase API like this too)!

Change 231724 had a related patch set uploaded (by Jdlrobson):
WikidataPageBanner should run Wikibase tests

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

Change 231724 merged by jenkins-bot:
WikidataPageBanner should run Wikibase tests

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

Jdlrobson closed this task as Resolved.Aug 15 2015, 12:42 AM
Jdlrobson claimed this task.

Let us know if anything else is needed!

Jdlrobson reopened this task as Open.Aug 15 2015, 3:59 AM

Seeing:
03:50:47 1) ResourcesTest::testMissingDependencies
03:50:47 The module 'wikibase' required by 'wikibase.datamodel.__namespace' must exist
03:50:47 Failed asserting that an array contains 'wikibase'.
03:50:47
03:50:47 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/structure/ResourcesTest.php:84
03:50:47 /mnt/jenkins-workspace/workspace/mwext-testextension-zend/src/tests/phpunit/MediaWikiTestCase.php:131
03:50:47
Have I configured it wrong.. or is there a bug in wikibase?

*sigh* I forgot about T95897, which needs to be fixed for it to work. (Otherwise Wikibase is disabled. The error comes from T109171 which we don't need to fix for this to work.)

Lydia_Pintscher moved this task from incoming to monitoring on the Wikidata board.Aug 17 2015, 3:17 PM

@JanZerebecki anything we can do in the mean time? e.g. run the extensions test in Wikibase builds? I just want to ensure any broken tests are caught before they hit any of our instances.

Change 232278 had a related patch set uploaded (by JanZerebecki):
Revert "Revert "WikidataPageBanner should run Wikibase tests""

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

Change 232278 merged by jenkins-bot:
Revert "Revert "WikidataPageBanner should run Wikibase tests""

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

I fixed the problem and restored your patch. It is now working.

API is definitely something we could explore - but doesn't that internally run an API request and I'm not sure if that would scale?

Not sure if that works for this case, but there is FauxRequest. I don't think the scalability of doing the API request is worse than doing the same thing via Wikibase internal functions.

Jdlrobson closed this task as Resolved.Aug 18 2015, 9:33 PM

Thanks a bunch @JanZerebecki !
Can you open a new task describing moving to API request and tag it with MobileFrontend and WikidataPageBanner - as MobileFrontend is doing exactly the same and it would be good to tackle this properly separately.

hashar triaged this task as High priority.Aug 24 2015, 2:03 PM
Jdlrobson moved this task from Epics to Backlog on the Wikidata-Page-Banner board.Aug 28 2015, 7:28 PM
Jdlrobson removed Jdlrobson as the assignee of this task.Sep 30 2015, 5:50 PM

The code change needs to be made in Continuous-Integration-Config no? Even the description mentions " integration/config.git/zuul/ext_dependencies.py "

So I'm very confused by the projects on this card. This doesn't require any changes in Wikidata nor WikidataPageBanner that I can see unless I'm missing something...

Right now the Wikidata extension is a soft dependency so I guess this would be a test that only works when both installed? (I assume you can skip it if not?)

Thanks for your clarifications!

Jhernandez lowered the priority of this task from High to Low.May 25 2016, 4:19 PM
Jhernandez moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.
Jhernandez added a project: patch-welcome.