optionally use node-cover when running npm test for backend code coverage data #2272
Conversation
|
@jrgm - One useful addition would be a separate scripts/test_backend_coverage script so this can be run without specifying extra environment variables while calling ./scripts/test. Is there further work you want to do on this before final review? |
|
@shane-tomlinson I can look into rearranging this a bit. It's already an interesting weave of stuff though ;-) I don't have anything to do add to this patch. I will rebase it later today. |
|
@jrgm If there's nothing else needed, I can do the rebase myself, since I'm sure you're a little busy :) |
|
Hey @zaach, can you look at these changes and check I didn't biff anything for PERSONA_DEBUG_MODE. And also the change to bin/router? |
…rage data
To run 'PERSONA_WITH_COVER=1 npm test'.
Changes to lockdown.json are:
rimraf@2.0.2
-> graceful-fs@1.1.14
cover@0.2.8
-> underscore@1.2.4
-> underscore.string@2.0.0
-> cli-table@0.0.2
-> colors@0.3.0
|
Okay, I rebased again. Can someone please review this and merge (before another change to package.json/lockdown.json makes me do it again)? |
|
@jrgm lgtm; no issues with routher or debug mode. r+ |
optionally use node-cover when running npm test for backend code coverage data
An experiment with running backend tests with a code coverage tool. I want to convince myself that the numbers make sense, although so far they (mostly) do. But I thought I'd put this up here for people to ponder and try out (and for me to refer to when I file some issues where we are missing tests).
npm installand setting PERSONA_WITH_COVER=1PERSONA_WITH_COVER=1 WHAT_TESTS=back npm testnode-coverwhich bundlesesprimafor js munging.run_locally.jsto start the daemons wrapped in thecovercommandrimrafto packages.json to remove the generated .code_coverage directory between runsbin/routerI had to register withrequire('../lib/shutdown').handleTerminationSignalsbin/static, the tests started failing. I should look more into shutdown to figure this out. For now,bin/staticusage of libs will be underreported.backare called for only for failure cases withback_mysql(./tests/stalled-mysql-tests.js))