Page MenuHomePhabricator

Template tests should use mock server and response
Closed, ResolvedPublic


The unit tests for templates were written in a way that hits the Wikipedia API directly. These should be adjusted to use fake server so the tests don't fail if the articles used in the tests change.

But this is not easy in CX1 because of the framework issue and the way templates are written. For example, it is required to mock 7 network request for an adaptation request.

The need to hit real wikipedia cause CI errors now and then(jenkins test fails).

The proposed solution is to disable this tests in CX1 and use CX2 framwork to renable them. CX2 has API request abstraction that can help in this kind of scenario.

Event Timeline

santhosh created this task.May 18 2017, 4:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 18 2017, 4:56 AM

Change 354178 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/extensions/ContentTranslation@master] Skip the template tests that need mock server

Change 354178 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix the Qunit failures

Arrbee closed this task as Resolved.May 30 2017, 7:29 AM