tests/image: format osbuild output in case of a failure
testify library cannot deal with error messages with length > 64k. Sadly, osbuild output is very long one line. This commits formats the output before making the error from it.
This commit is contained in:
parent
2435163fc9
commit
e6f323e6b6
1 changed files with 3 additions and 1 deletions
|
|
@ -50,7 +50,9 @@ func runOsbuild(manifest []byte, store string) (string, error) {
|
|||
|
||||
if err != nil {
|
||||
if _, ok := err.(*exec.ExitError); ok {
|
||||
return "", fmt.Errorf("running osbuild failed: %s", outBuffer.String())
|
||||
var formattedOutput bytes.Buffer
|
||||
_ = json.Indent(&formattedOutput, outBuffer.Bytes(), "", " ")
|
||||
return "", fmt.Errorf("running osbuild failed: %s", formattedOutput.String())
|
||||
}
|
||||
return "", fmt.Errorf("running osbuild failed from an unexpected reason: %#v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue