gotwarlost/istanbul — pull request #269 by davidlehn (2014-10-23 20:20:01+00:00)
Title: Add option to include pid in coverage filename.

This is an attempt to address the usage of Istanbul in a multi-process environment. Rather than addressing the specifics of a particular multi-process technique, a tool is added that could be of use to different methods: a `--include-pid` option is added to append the process id to coverage filenames. This has worked out well for use with the node cluster module. Generating your own directory names for use with `--dir` won't work with the cluster module since you can't adjust parameters per child.

This patch may help address a number of current and old issues: #97, #115, #147, #199, and maybe others.

Test case code is not yet written but thought I'd put this patch out for feedback now.

From the commit:
- Add an option to append the process id to the coverage filename.
- Including a PID in filenames can be used to make it easier to perform
coverage testing of multiple process applications. If invoked
properly, each process will create a unique coverage file which can
then be merged during reporting.
- Add example in the README of how to use this support with the cluster
module.