Commit 49229f5d authored by Adrian Sutton's avatar Adrian Sutton

op-e2e: Include build output in failure message.

When the op-program-client build fails, include the build output in the failure message instead of logging to stdout/stderr where it gets lost amongst the other test output.
parent a298160f
...@@ -2,8 +2,8 @@ package op_e2e ...@@ -2,8 +2,8 @@ package op_e2e
import ( import (
"context" "context"
"os"
"os/exec" "os/exec"
"strings"
"testing" "testing"
"time" "time"
...@@ -17,9 +17,10 @@ func BuildOpProgramClient(t *testing.T) string { ...@@ -17,9 +17,10 @@ func BuildOpProgramClient(t *testing.T) string {
defer cancel() defer cancel()
cmd := exec.CommandContext(ctx, "make", "op-program-client") cmd := exec.CommandContext(ctx, "make", "op-program-client")
cmd.Dir = "../op-program" cmd.Dir = "../op-program"
cmd.Stdout = os.Stdout // for debugging var out strings.Builder
cmd.Stderr = os.Stderr // for debugging cmd.Stdout = &out
require.NoError(t, cmd.Run(), "Failed to build op-program-client") cmd.Stderr = &out
require.NoErrorf(t, cmd.Run(), "Failed to build op-program-client: %v", &out)
t.Log("Built op-program-client successfully") t.Log("Built op-program-client successfully")
return "../op-program/bin/op-program-client" return "../op-program/bin/op-program-client"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment