JSON output to stdout
Hi, is there a way to avoid printing anything but what produced by reporting nodes to stdout? We would need to have on stdout only JSON formatted ouput for logging purposes, and we're thinking to use reporting nodes for that. However ever it seems not possible to mute all others ginkgo outputs. Thanks
hey - that is not currently supported. it would not be too hard to add a -mute option or something. if you’re interested in submitting a PR I can show you were to make adjustments.
Hi I would be happy to contribute if I'll have some time. Please show me where can I add the changes. Thanks!
hey there, sure thing. i'm not 100% confident this is all you need to do. But a rough outline:
- Add a new
muteflag to theReporterConfigand flagset in https://github.com/onsi/ginkgo/blob/master/types/config.go - Have the core DSL create a
NoopReporter{}instead of aDefaultReporterif the mute flag is set: https://github.com/onsi/ginkgo/blob/master/core_dsl.go#L261 (This will cover the case when running in series) - When running in parallel the output is actually coming from the CLI - so you'll want to pass
NoopReporterin to the parallel server if themuteflag is set: https://github.com/onsi/ginkgo/blob/master/ginkgo/internal/run.go#L174 - You'll then want to add an integration test. Probably in this file: https://github.com/onsi/ginkgo/blob/master/integration/reporting_test.go
- And, lastly, you'll want to update the docs to describe the
-muteflag. Probably somewhere here: https://github.com/onsi/ginkgo/blob/master/docs/index.md#controlling-verbosity
Hi @onsi, please let me know if this is still open, I am ready to pick it up.
hey so so sorry for the delay. yes it's totally available and ready to be picked up (if you still have the time!!) and the outline i shared still holds but let me know if you run into issues or it doens't make sense (i'll aim to be more responsive, going forward - sorry about that)