Page MenuHomePhabricator

Write pure unit tests for all Kartographer service classes
Closed, ResolvedPublic

Description

As part of T263762: Make Kartographer extension compatible with Parsoid we moved a lot of code into smaller, independent service classes that can be reused by both parsers. All this code was and still is sufficiently covered by the previously existing PHPUnit tests as well as an extensive set of parser tests. Unfortunately this is not reflected in the coverage report: https://doc.wikimedia.org/cover-extensions/Kartographer.

While there are several easy ways to fix this, we think the best is to write new, clean, pure unit tests for these classes.

Some really trivial classes/methods can be marked with @codeCoverageIgnore.

Event Timeline

Change 927738 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Add very basic tests for MapTagArgumentValidator & Tag classes

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

Change 927738 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Add very basic tests for MapTagArgumentValidator & Tag classes

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

MSantos subscribed.

@thiemowmde is there anything else that we should be tracking in this ticket or can it be marked as resolved?

Change 928979 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Improve test coverage with fast, pure unit tests

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

Change 928979 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Improve test coverage with fast, pure unit tests

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

Change 929380 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Improve test coverage of special page and tag classes

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

Change 929380 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Improve test coverage of special page and tag classes

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

thiemowmde moved this task from Review to Done on the WMDE-TechWish-Maintenance-2023 board.

Line coverage is 80% now. I think what's left is either to trivial to be worth a separate tests or needs to be a more complex integration test. That's better done as we go.