Page MenuHomePhabricator

Missing unit tests for pywikibot library (tracking)
Open, NormalPublic

Description

This is a task tracking unit tests that should be added, and provides instructions on how to find new unit tests that should be added . Adding unit tests is a simple way for new contributors to explore the library.

To find code not yet tested, browse https://codecov.io/github/wikimedia/pywikibot-core .

Some 'missing tests' information extracted from comments in the source code of the tests:

site_tests: newimages, longpages, shortpages, ancientpages, unwatchedpages

page_tests: autoFormat, isAutoTitle (only partially done), getOldVersion, getReferences, backlinks, embeddedin, getVersionHistory, getVersionHistoryTable, fullVersionHistory, contributingUsers

There are also some notes on using coverage at https://www.mediawiki.org/wiki/Manual:Pywikibot/Test_coverage#Library

Google Code-in clonable task description:

Browse [codecov analysis of Pywikibot](https://codecov.io/gh/wikimedia/pywikibot-core) and select a set of lines of code that are not yet exercised by the [extensive test suite](https://github.com/wikimedia/pywikibot-core/tree/master/tests). 
Add a unit test which exercises that set of lines of code to the test suite, and after the code is merged it will be automatically [tested on travis-ci](https://travis-ci.org/wikimedia/pywikibot-core/builds). 
[Create bug reports](https://www.mediawiki.org/wiki/How_to_report_a_bug) in [Wikimedia Phabricator](https://www.mediawiki.org/wiki/Phabricator/Help) for any relevant failures encountered. 
See the provided patch in Gerrit at https://gerrit.wikimedia.org/r/#/c/178891 as an example of this task.

The Phabricator task for tracking missing library tests is https://phabricator.wikimedia.org/T60941

Pywikibot is a Python-based framework to write bots for MediaWiki ([more information](https://www.mediawiki.org/wiki/Manual:Pywikibot). [Documentation on Gerrit is available](https://www.mediawiki.org/wiki/Manual:Pywikibot/Gerrit).

Mentors: @jayvdb

Details

Reference
bz58941

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 179053 had a related patch set uploaded (by John Vandenberg):
Remove lists of missing tests

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

Patch-For-Review

Change 179124 had a related patch set uploaded (by John Vandenberg):
Re-enable site tests commented out due to old bugs

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

Patch-For-Review

Change 179124 merged by jenkins-bot:
Re-enable site tests commented out due to old bugs

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

Change 179053 merged by jenkins-bot:
Remove lists of missing tests

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

jayvdb renamed this task from [tracking] Missing unit tests to [tracking] Missing unit tests for pywikibot library.Nov 11 2015, 9:15 PM
jayvdb updated the task description. (Show Details)
jayvdb edited projects, added Google-Code-In-2015; removed Patch-For-Review.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 11 2015, 9:15 PM

I will mentor this in GCI 2015

jayvdb renamed this task from [tracking] Missing unit tests for pywikibot library to [tracking] [clonable] Missing unit tests for pywikibot library.Nov 11 2015, 9:15 PM

How do I submit my test? Do I submit a patch (created by git diff)? If yes, where?

Please refer to "How to submit a patch" on https://www.mediawiki.org/wiki/Gerrit/Tutorial - no "git diff" involved. :)

Change 261866 had a related patch set uploaded (by Sn1per):
Unit tests for Site.{long,short,ancient,unwatched}pages()

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

Change 261866 merged by jenkins-bot:
Unit tests for Site.{long,short,ancient,unwatched}pages()

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

Change 265674 had a related patch set uploaded (by AndyTechGuy):
Add tests for deprecated namespace shortcuts

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

Change 265674 merged by jenkins-bot:
Add tests for deprecated namespace shortcuts

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

jayvdb updated the task description. (Show Details)Jan 26 2016, 6:34 AM
jayvdb updated the task description. (Show Details)Jan 26 2016, 6:36 AM
Danny_B added a subscriber: Danny_B.
Danny_B removed a subscriber: Danny_B.
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 21 2016, 8:55 PM
Danny_B renamed this task from [tracking] [clonable] Missing unit tests for pywikibot library to Missing unit tests for pywikibot library (tracking).May 27 2016, 6:00 PM
jayvdb updated the task description. (Show Details)Nov 22 2016, 8:01 AM
jayvdb updated the task description. (Show Details)
jayvdb updated the task description. (Show Details)Nov 22 2016, 8:06 AM

This one hasnt been published yet.

jayvdb updated the task description. (Show Details)Oct 23 2017, 6:10 AM
jayvdb added a project: Google-Code-in-2017.
jayvdb updated the task description. (Show Details)
jayvdb updated the task description. (Show Details)
This comment was removed by Framawiki.

Some subtasks are also listed in New tests needed column on Pywikibot-tests

Change 401083 had a related patch set uploaded (by Anpans; owner: Anpans):
[pywikibot/core@master] [TEST] Add Test for site.botusers() method

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

Change 401083 merged by jenkins-bot:
[pywikibot/core@master] [TEST] Add Test for site.botusers() method

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

Change 401408 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[pywikibot/core@master] [TEST] Add tests for User class

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

Dvorapa removed a subscriber: Dvorapa.Jan 1 2018, 10:25 PM

Change 401408 merged by jenkins-bot:
[pywikibot/core@master] [TEST] Add tests for User class

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

Change 402415 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[pywikibot/core@master] [TEST] Add tests to a bot account for User class

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

Change 402415 merged by jenkins-bot:
[pywikibot/core@master] [TEST] Add tests to a bot account for User class

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

Change 405027 had a related patch set uploaded (by Framawiki; owner: Framawiki):
[pywikibot/core@master] [TEST] Add tests for flow.Topic class

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

Change 405027 merged by jenkins-bot:
[pywikibot/core@master] [TEST] Add tests for flow.Topic class

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

Change 404076 had a related patch set uploaded (by Eisenhaus335; owner: Eisenhaus335):
[pywikibot/core@master] Create Module Tests

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

Change 404076 abandoned by Xqt:
Create Module Tests

Reason:
See my last comment

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

Dvorapa moved this task from Backlog to Tracking tasks on the Pywikibot board.Mar 18 2018, 3:40 PM

Change 478731 had a related patch set uploaded (by Xqt; owner: Xqt):
[pywikibot/core@master] [tests] exclude some files and folders from code coverage

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

Change 478731 merged by jenkins-bot:
[pywikibot/core@master] [tests] exclude some files and folders from code coverage

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