Page MenuHomePhabricator

Unit test MediaWiki communication works fine
Closed, ResolvedPublic

Description

Required skills

  • Basic Python knowledge.

Problem

Developers might break MediaWiki communication methods (defined in trackersite/tracker/models.py, MediaInfo class) unintentionally, which breaks Tracker unless an user notices the bug.

Proposed solution

Implement tests for MediaInfo.add_to_mediawiki, MediaInfo.remove_from_mediawiki and MediaInfo.store_mediawiki_data. You don't need to actually write anything into MediaWiki when tests are runned to consider this task completed, however, if you decide to do so, it will be taken into account when Wikimedia decides about the winners.

Student is expected to send a patch for wikimedia-cz/tracker repository, hosted at Wikimedia Gerrit. When claiming task on GCI website, student should claim a respective Phabricator task as well.

Materials

Event Timeline

Hi!
I don't understand well what I need to do to do this task.

  • If I sent requests to MediaWiki, it will update Wikimedia data, no?
  • What is supposed that I need to write into MediaWiki, so it will be taken into account when Wikimedia decides about the winners?

Regards

Hi, you can mock the methods with https://docs.python.org/3/library/unittest.mock.html, and assert the methods are called as expected.

Change 564773 had a related patch set uploaded (by Alcarazzam; owner: Alcarazzam):
[wikimedia-cz/tracker@master] Test MediaWiki communication works fine

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

Change 564773 merged by jenkins-bot:
[wikimedia-cz/tracker@master] Test MediaWiki communication works fine

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