midniteio / multi-cuke

Parallel cucumber-js testing via Node's child_process.spawn api
13 stars 4 forks source link

Support debug logging from within silenced workers #15

Closed midniteio closed 8 years ago

midniteio commented 8 years ago

This has a significant amount of files changed due to adding a missed linting rule that I apparently abused.

This important pieces mostly revolve around messages form child processes having a type property, either "log" or "result", and handling them accordingly (https://github.com/midniteio/multi-cuke/compare/agnostic-log?expand=1#diff-eaff106c200e864c5c8afff31620f472R90).

This purpose to this PR is to satisfy https://github.com/midniteio/multi-cuke/issues/9, where silent: true on the forked processes means console.log will not display when running in parallel. This sets up the ability to batch logs from tests, and adds a utility in src/lib/utils/worker-log-handler.js to allow a variable defined in cucumber's world to act as a logger that would work whether in silenced child process or not. See documentation updates in this PR for more details.