Closed jasondborneman closed 1 year ago
It is not properly documented, but this is already possible with comma-separated values.
Please try:
$ go test --godog.format=pretty:stdout,junit:file.xml
You rock, @vearutop! Although it looks like it actually needs to be:
$ go test --godog.format=pretty,junit:file.xml
No :stdout
, but other than that it works a charm. I should have tried that!
🤔 What's the problem you're trying to solve?
Currently (AFAIK) you can only define a single
--godog.format
output for your tests. Ideally you could define multiple outputs, one for stdout to the command line and any number of other outputs to files.This would be useful so that, for example, you run tests as part of CI/CD and can see
--godog.format=pretty
on the command line output, but send--godog.format=junit:file.xml
to the file and BOTH would work.✨ What's your proposed solution?
Support multiple format options. Maybe something like this on the command line:
This would send
pretty
format to stdout but send thejunit
report to a file.⛏ Have you considered any alternatives or workarounds?
I tried gotestsum as a solution, but its junit reports seem... iffy. They show 0 tests and a failure just shows all output in the testcase block. The junit reports that come with godog natively are MUCH better and would like to use those instead.
📚 Any additional context?
Feel free to contact me in the comments here to clarify anything that is needed. This would be a huge level up for what we're trying to do! Maybe there's already a way to do this and I just missed it since I'm new to
godog
. Thanks!