gotestsum icon indicating copy to clipboard operation
gotestsum copied to clipboard

Using --raw-command with stderr

Open jackwhelpton opened this issue 3 years ago • 1 comments

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?

jackwhelpton avatar Aug 29 '21 20:08 jackwhelpton

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.

jackwhelpton avatar Aug 29 '21 21:08 jackwhelpton