fix: mire test failing is some command inside of bash failed

This commit is contained in:
2026-03-22 20:25:29 +00:00
parent 19d7c2bb3e
commit 12cb12991a
3 changed files with 35 additions and 15 deletions
+6 -6
View File
@@ -52,12 +52,12 @@ func TestReplayCapturesOutput(t *testing.T) {
cmd := exec.Command("sh", "-c", `read line; printf '__MIRE_E2E_BEGIN__\nline:%s\n' "$line"`)
var outputLog bytes.Buffer
if err := Replay(ReplayRequest{
if result := Replay(ReplayRequest{
Cmd: cmd,
Input: []byte("hello\n"),
OutputLog: &outputLog,
}); err != nil {
t.Fatalf("Replay() error = %v", err)
}); result.Err() != nil {
t.Fatalf("Replay() error = %v", result.Err())
}
got := outputLog.String()
@@ -77,13 +77,13 @@ func TestReplayWaitsForInputReadySignal(t *testing.T) {
close(ready)
}()
if err := Replay(ReplayRequest{
if result := Replay(ReplayRequest{
Cmd: cmd,
Input: []byte("hello\n"),
InputReady: ready,
OutputLog: &outputLog,
}); err != nil {
t.Fatalf("Replay() error = %v", err)
}); result.Err() != nil {
t.Fatalf("Replay() error = %v", result.Err())
}
if elapsed := time.Since(start); elapsed < 100*time.Millisecond {