Page MenuHomePhabricator

Write Graphoid-specific tests
Closed, ResolvedPublic

Description

In order to have as less surprises as possible in production, we require at least 80% code coverage. Current report indicates only 73% of statements and 49% of branches are covered.

=============================== Coverage summary ===============================
Statements   : 73.68% ( 266/361 )
Branches     : 49.68% ( 77/155 )
Functions    : 80.33% ( 49/61 )
Lines        : 74.58% ( 264/354 )
================================================================================

Event Timeline

Mvolz assigned this task to Yurik.
Mvolz raised the priority of this task from to High.
Mvolz updated the task description. (Show Details)
Mvolz added subscribers: mobrovac, Aklapper, Mvolz.
Mvolz removed Yurik as the assignee of this task.Mar 25 2015, 6:17 PM
Mvolz set Security to None.

Change 202260 had a related patch set uploaded (by Yurik):
Implemented unit tests, fixed flaky isNode code

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

Change 202260 merged by Yurik:
Implemented unit tests, fixed flaky isNode code

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

Yurik claimed this task.
mobrovac updated the task description. (Show Details)
mobrovac removed a project: Patch-For-Review.

Reopening as this needs more work

@mobrovac, please document this in a on-wiki guide - it has never been mentioned before.

@mobrovac, The code coverage for v1.js already passes your requirement:

Statements: 80.58% (166 / 206)      Branches: 61.54% (56 / 91)      Functions: 78.13% (25 / 32)      Lines: 80.58% (166 / 206)

If i remove the unused wrapMetrics() function, which is used for debugging, it goes up to this

Statements: 84.1% (164 / 195)      Branches: 62.92% (56 / 89)      Functions: 86.21% (25 / 29)      Lines: 84.1% (164 / 195)

I would like to keep that function, or you can add it to util.js, as it allows debugging of the metrics events in the regular log. In either case, route/v1.js has >80% coverage, and other code like util.js is identical to node-service-template, and is simply not used.