making tests pass on actions by grepping out pipefail which is flakily recorded due to actions not recording line numbers

This commit is contained in:
David Dworken 2022-04-15 18:06:48 -07:00
parent ba2f8ae452
commit 682a063e95
2 changed files with 5 additions and 3 deletions

View File

@ -563,13 +563,15 @@ echo hello2
t.Fatalf("hishtory query contains a result that should not have been recorded, out=%#v", out)
}
out = RunInteractiveBashCommands(t, "hishtory export")
expectedOutput := "set -emo pipefail\necho hello1\necho hello2\nset -emo pipefail\nset -emo pipefail\nhishtory query\nset -emo pipefail\n"
out = RunInteractiveBashCommands(t, "hishtory export | grep -v pipefail")
expectedOutput := "echo hello1\necho hello2\nhishtory query\n"
if out != expectedOutput {
t.Fatalf("hishtory export has unexpected output=%#v", out)
}
}
// TODO: A test that has a complex bash pipeline
func waitForBackgroundSavesToComplete(t *testing.T) {
for i := 0; i < 20; i++ {
cmd := exec.Command("pidof", "hishtory")

View File

@ -99,7 +99,7 @@ func RunTestServer() func() {
if strings.Contains(stderr.String()+stdout.String(), "failed to") {
panic(fmt.Sprintf("server failed to do something: stderr=%#v, stdout=%#v", stderr.String(), stdout.String()))
}
// fmt.Printf("stderr=%#v, stdout=%#v\n", stderr.String(), stdout.String())
fmt.Printf("stderr=%#v, stdout=%#v\n", stderr.String(), stdout.String())
}
}