Page MenuHomePhabricator

Add proper tests for MobileApps service routes
Closed, ResolvedPublic2 Estimated Story Points

Description

Currently there are no tests encompassing the routes exposed by the service. Code coverage reports:

File		Statements		Branches		Functions		Lines	
lite.js		38.24%	(13 / 34)	0%	(0 / 4)	16.67%	(1 / 6)	38.24%	(13 / 34)
page.js		18.83%	(42 / 223)	0%	(0 / 70)	3.13%	(1 / 32)	18.83%	(42 / 223)

These numbers (especially statements and branches) should be at least 80%. Please write the tests.

Event Timeline

mobrovac assigned this task to bearND.
mobrovac raised the priority of this task from to Unbreak Now!.
mobrovac updated the task description. (Show Details)
mobrovac added a subscriber: mobrovac.

Change 216037 had a related patch set uploaded (by BearND):
Add tests for mobileapp-page

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

My first patch set of the test patch (which was based on earlier code) had > 90% coverage for the mobileapp-page routes.
The coverage dropped after I rebased the Parsoid patch. In a later patch I'll look into adding the edit buttons for the sections back, which should help using some of the current dead code.

@Dbrant is going to add tests for the mobileapp-lite routes.

Change 216037 merged by BearND:
Add tests for mobileapp-page

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

Nice work @bearND ! (Sorry for the review delay)

@moborvac Would you mark this task as resolved? Can we get the service into the SCA cluster now? Or what is still needed? Thank you!

There should be some tests for the lite routes as well, since it will enter production as well. IMHO, that shouldn't be too hard (more or less the same tests could apply to the lite version as well, if I'm not mistaken).

After that, there is the diagram to be given to ops, I'll post more info on that in the parent task.

Change 217520 had a related patch set uploaded (by Dbrant):
Add tests for Lite route.

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

Change 217520 merged by Mobrovac:
Add tests for Lite route.

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

mobrovac removed a project: Patch-For-Review.

This is now complete. Thnx @bearND and @Dbrant !