gotestsum
gotestsum copied to clipboard
Using --raw-command with stderr
I'm using a CI tool that acts as a wrapper for the Go command and emits the results via stderr rather than stdout. I've tried various ways of incorporating this into the raw command, along the lines of:
gotestsum --junitfile test.xml --ignore-non-json-output-lines --raw-command -- jfrog rt go test -v -json ./... 2>&1
but am always ending up with an empty output (and stderr appearing in the console). Is there a recommended way to parse stderr using gotestsum?
My workaround for now is to use a simple wrapper script:
#!/bin/sh
set -e
jfrog "$@" 2>&1
but any better suggestions would be welcome.