{"action":"created","issue":{"url":"https://api.github.com/repos/gotwarlost/istanbul/issues/199","labels_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/199/comments","events_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/199/events","html_url":"https://github.com/gotwarlost/istanbul/issues/199","id":32751373,"number":199,"title":"instrumentation for multi-process code","user":{"login":"jsdevel","id":2605980,"avatar_url":"https://avatars.githubusercontent.com/u/2605980?v=3","gravatar_id":"","url":"https://api.github.com/users/jsdevel","html_url":"https://github.com/jsdevel","followers_url":"https://api.github.com/users/jsdevel/followers","following_url":"https://api.github.com/users/jsdevel/following{/other_user}","gists_url":"https://api.github.com/users/jsdevel/gists{/gist_id}","starred_url":"https://api.github.com/users/jsdevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsdevel/subscriptions","organizations_url":"https://api.github.com/users/jsdevel/orgs","repos_url":"https://api.github.com/users/jsdevel/repos","events_url":"https://api.github.com/users/jsdevel/events{/privacy}","received_events_url":"https://api.github.com/users/jsdevel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-05-03T17:36:52Z","updated_at":"2015-01-01T18:38:03Z","closed_at":null,"body":"I have a project that'll end up being a CLI to start a daemon.  The daemon will start an express app, and will allow REST interaction to start clusters.  The clusters will all call `fork()`.\r\n\r\nI can take the unit test approach and use `istanbul cover` with no problems; however, I see more value in being able to test my application from a very high level.  So I've created a simple bash script that will interact with the CLI and exercise the application in that fashion.  I'd really like to handle code coverage in this way if possible.\r\n\r\nAt first I attempted to instrument all my files, and require the covered entry module from the CLI script based on the existence of an env var.  Unfortunately, the instrumented code doesn't do any sort of reporting on it's own, so my baseline coverage files never get updated.  \r\n\r\n*Punchline:*  It would be really nice if there was an option with `istanbul instrument` that would embed a reporter in the instrumented files.  This would allow the `baseline-coverage.json` files to get updated across processes.  I've been browsing the issues that are currently open related to multi proc / clustered code (#147, #127, #115), and I believe the proposed solution herein would solve them more elegantly.\r\n\r\nI currently work at GoDaddy, and I know several of the engineers / architects would prefer to take this approach to testing where possible. /cc @asilvas @tracker1 @azweb76"},"comment":{"url":"https://api.github.com/repos/gotwarlost/istanbul/issues/comments/68494208","html_url":"https://github.com/gotwarlost/istanbul/issues/199#issuecomment-68494208","issue_url":"https://api.github.com/repos/gotwarlost/istanbul/issues/199","id":68494208,"user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"created_at":"2015-01-01T18:38:03Z","updated_at":"2015-01-01T18:38:03Z","body":"Just want to +1 this. In jadejs/jade, we are testing the `jade` CLI app with `childProcess.spawn()` and `.exec()`. It's a pity that istanbul is unable to pick that up."}}