Page MenuHomePhabricator

[Epic] Improve PHPUnit coverage in MobileFrontend to 50%
Closed, DeclinedPublic

Description

MobileFrontend's PHP code coverage is currently very low (at time of writing this ticket, it is 27% (and low!)

See:
https://doc.wikimedia.org/cover-extensions/MobileFrontend/

We would like to improve things here, with a target of at least 50% as a starting point.

Suggested focus errors

  • Remove redundant code
  • write tests for the Amc folder
  • write tests for MobileFrontendHooks.php

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
ResolvedJdlrobson
DeclinedNone
DeclinedNone
DuplicateNone
Resolved nray
Resolvedphuedx
ResolvedAnomie
ResolvedAnomie
ResolvedAnomie
ResolvedEBernhardson
ResolvedAnomie
ResolvedAnomie
DuplicateNone
ResolvedNone
Resolvedphuedx
DeclinedNone
OpenNone
Resolvedphuedx
Resolvedphuedx
DeclinedNone
OpenSpikeNone
DeclinedNone
ResolvedAmmarpad
ResolvedxSavitar
ResolvedxSavitar
ResolvedxSavitar
ResolvedxSavitar
Resolvedpmiazga
OpenNone
ResolvedxSavitar
ResolvedNone
ResolvedxSavitar
ResolvedNone
Resolvedphuedx
Resolvedpmiazga
DeclinedNone
ResolvedSpikeovasileva
ResolvedJdlrobson
DeclinedNone
OpenNone
OpenNone
Resolvedcscott
Invalid GWicke
Resolvedliangent
Resolvedthiemowmde
OpenNone
Resolvedcscott
Resolvedcscott
Resolved Elitre
Resolvedcscott
Resolvedcscott
Resolvedcscott
Resolvedcscott
Resolvedcscott
OpenNone
DuplicateBUG REPORTNone
Resolvedcscott
OpenNone
OpenNone
OpenNone
OpenNone
ResolvedBUG REPORTJgiannelos
OpenNone
DeclinedNone
ResolvedJdlrobson
ResolvedJdlrobson
DuplicateNone
DuplicateNone
ResolvedTgr
ResolvedAnomie
Resolvedtstarling
Resolvedcoren
ResolvedAnomie
DeclinedBUG REPORTNone
ResolvedAnomie
ResolvedEsanders
ResolvedEsanders
Resolvedssastry
ResolvedAnomie
ResolvedCKoerner_WMF
Resolvedjhsoby
ResolvedTgr
DeclinedTgr
Resolvedcoren
ResolvedAnomie
ResolvedTgr
DeclinedNone
Resolvedssastry
ResolvedTgr
ResolvedTgr
ResolvedTgr
Resolved Deskana
ResolvedCKoerner_WMF
Resolved Whatamidoing-WMF
ResolvedTgr
ResolvedTgr
ResolvedTgr
ResolvedUrbanecm
ResolvedTgr
ResolvedTacsipacsi
ResolvedTgr
ResolvedCKoerner_WMF
ResolvedJdlrobson
DeclinedNone
DeclinedNone
OpenNone
ResolvedAmmarpad
ResolvedJdlrobson
ResolvedKizule
ResolvedKizule
DuplicateBrandonXLF
ResolvedJdlrobson
ResolvedAmmarpad
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson

Event Timeline

hey @pmiazga ! @D3r1ck01 has expressed a desire to help us improve our PHP code coverage as a way to learn more about unit testing. I've said I'd help provide guidance and code review. I'm guessing you would also be interested in doing this?

As a short term goal we'd seek 50% code coverage, then onwards to 70+.

@D3r1ck01 have you seen https://tools.wmflabs.org/coverme/?repo=Extension%3AMobileFrontend&type=all ? It gives a good idea of where your tests can have the most impact!

Jdlrobson triaged this task as Medium priority.Jan 11 2019, 12:54 AM

We are currently at 33% so getting close to the 50% mark. Do we have tasks to take this over the finish line? The Amc and specials folder would be a good place to start.

https://doc.wikimedia.org/cover-extensions/MobileFrontend/

Jdlrobson renamed this task from [Epic] Improve PHPUnit coverage in MobileFrontend to medium to [Epic] Improve PHPUnit coverage in MobileFrontend to 50%.Jan 21 2021, 9:20 PM
Jdlrobson added a project: patch-welcome.
Jdlrobson updated the task description. (Show Details)

Currently at 31.28$ (28th April). I am not sure code coverage is a good goal right now for this repo, since most of our efforts are around removing code from the repository - in particular the specials folder (1258 lines of code with only 4.13% coverage) and API (305 / 478 lines of code coverage).

I think if we were interested in improving code coverage, I would recommend MobileContext.php (see T143189) and patches are very much welcome there.