Page MenuHomePhabricator

Improve Test Coverage for WikiPage class
Closed, ResolvedPublic

Description

In preparation of refactoring WikiPage for Multi-Content-Revision support, we need to improve test coverage, so we don't break things.

Note that WikiPage is quite hard to test, since it covers multiple concerns, and triggers many asynchronous actions, generally via global state.

The main focus of this effort will for now be to fully test all code that leads to changes in the database, and ensuring that these changes are correct.

Coverage report: https://doc.wikimedia.org/cover/mediawiki-core/includes/page/WikiPage.php.html

Most important methods to test, in order of priority:

In all cases, the focus should be on making sure that the database is updated in the expected way. The database layer should not be mocked.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

daniel created this task.Nov 20 2017, 7:27 PM
Restricted Application added a project: User-Addshore. · View Herald TranscriptNov 20 2017, 7:27 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore moved this task from Unsorted 💣 to Next on the User-Addshore board.Nov 20 2017, 7:29 PM
daniel moved this task from Inbox to Next on the Multi-Content-Revisions board.Nov 20 2017, 7:29 PM
Addshore updated the task description. (Show Details)Nov 22 2017, 11:06 PM

Change 393599 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Split WikiPageTest into ContentHandler & NoContentHandler tests

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

Change 393761 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] WikiPage tests @covers for doDeleteArticleReal & commitRollback

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

Change 393765 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Refactor test for WikiPage::doRollback

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

Change 394972 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Test for WikiPage::updateRedirectOn

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

Change 394980 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::insertRedirectEntry

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

Addshore updated the task description. (Show Details)Dec 4 2017, 1:02 PM

Change 394995 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Test for WikiPage::newFromRow

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

Change 394996 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::newFromID

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

Change 395005 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Test for WikiPge::insertProtectNullRevision

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

Addshore updated the task description. (Show Details)Dec 4 2017, 3:02 PM

Change 395016 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::updateRevisionOn

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

Addshore updated the task description. (Show Details)Dec 4 2017, 3:40 PM
Addshore updated the task description. (Show Details)Dec 4 2017, 4:10 PM

Change 395057 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::doUpdateRestrictions

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

Addshore updated the task description. (Show Details)Dec 4 2017, 6:24 PM
Addshore moved this task from Back Burner 🏛️ to Active 🚁 on the User-Addshore board.

Change 393599 merged by jenkins-bot:
[mediawiki/core@master] Split WikiPageTest into ContentHandler & NoContentHandler tests

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

Change 393761 merged by jenkins-bot:
[mediawiki/core@master] WikiPage tests @covers for doDeleteArticleReal & commitRollback

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

Change 393765 merged by jenkins-bot:
[mediawiki/core@master] Refactor test for WikiPage::doRollback

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

Change 394357 merged by jenkins-bot:
[mediawiki/core@master] Add test for WikiPage::updateCategoryCounts

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

Change 394972 merged by jenkins-bot:
[mediawiki/core@master] Test for WikiPage::updateRedirectOn

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

Change 394980 merged by jenkins-bot:
[mediawiki/core@master] Tests for WikiPage::insertRedirectEntry

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

Change 394995 had a related patch set uploaded (by Legoktm; owner: Addshore):
[mediawiki/core@master] Test for WikiPage::newFromRow

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

Change 394996 had a related patch set uploaded (by Legoktm; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::newFromID

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

Change 395005 had a related patch set uploaded (by Legoktm; owner: Addshore):
[mediawiki/core@master] Test for WikiPge::insertProtectNullRevision

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

Change 395016 had a related patch set uploaded (by Legoktm; owner: Addshore):
[mediawiki/core@master] Tests for WikiPage::updateRevisionOn

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

Change 394995 merged by jenkins-bot:
[mediawiki/core@master] Test for WikiPage::newFromRow

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

Change 394996 merged by jenkins-bot:
[mediawiki/core@master] Tests for WikiPage::newFromID

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

Change 395005 merged by jenkins-bot:
[mediawiki/core@master] Test for WikiPge::insertProtectNullRevision

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

Change 395016 merged by jenkins-bot:
[mediawiki/core@master] Tests for WikiPage::updateRevisionOn

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

Addshore closed this task as Resolved.Dec 7 2017, 6:54 PM
Addshore reopened this task as Open.
Addshore moved this task from Active 🚁 to Closing ✔️ on the User-Addshore board.

Bah, this was mean to be the Revision ticket...

Addshore updated the task description. (Show Details)Dec 7 2017, 6:57 PM
thiemowmde triaged this task as High priority.Dec 11 2017, 4:05 PM

Change 395057 merged by jenkins-bot:
[mediawiki/core@master] [MCR] Tests for WikiPage::doUpdateRestrictions

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

Addshore closed this task as Resolved.Jan 5 2018, 10:37 AM
Addshore updated the task description. (Show Details)

Test coverage is still not perfect, but at least we have good coverage of code that modifies the database now.