-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Hi,
Is there a way to set console / stdout redirects for each cucumber worker when running with the -parallel switch?
I have a project where parallelism is implemented via a shell script that spawns multiple cucumber processes, each redirecting stdout / stderr to its own file.
This works nicely. But this limits parallelism on the feature file level.
I'd like to utilize scenario-level parallelism. -parallelism
is perfect for that and it works great. I can route any console logging of the process itself to a specific file. But I can't seem to hook into cucumber to do the same. So Gherkin steps are still shown interleaved.
Essentially I set up a logger such as winston
, and simply redirect the console:
const logger = winston.createLogger(...)
console.log = (message) => {
logger.info(message);
};
console.info = (message) => {
logger.info(message);
};
...
Works great for the process, but Cucumber itself likely writes directly to stdout, which I'm not touching here.