mirror of
https://github.com/ddworken/hishtory.git
synced 2025-06-24 05:51:38 +02:00
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:
parent
ba2f8ae452
commit
682a063e95
@ -563,13 +563,15 @@ echo hello2
|
|||||||
t.Fatalf("hishtory query contains a result that should not have been recorded, out=%#v", out)
|
t.Fatalf("hishtory query contains a result that should not have been recorded, out=%#v", out)
|
||||||
}
|
}
|
||||||
|
|
||||||
out = RunInteractiveBashCommands(t, "hishtory export")
|
out = RunInteractiveBashCommands(t, "hishtory export | grep -v pipefail")
|
||||||
expectedOutput := "set -emo pipefail\necho hello1\necho hello2\nset -emo pipefail\nset -emo pipefail\nhishtory query\nset -emo pipefail\n"
|
expectedOutput := "echo hello1\necho hello2\nhishtory query\n"
|
||||||
if out != expectedOutput {
|
if out != expectedOutput {
|
||||||
t.Fatalf("hishtory export has unexpected output=%#v", out)
|
t.Fatalf("hishtory export has unexpected output=%#v", out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: A test that has a complex bash pipeline
|
||||||
|
|
||||||
func waitForBackgroundSavesToComplete(t *testing.T) {
|
func waitForBackgroundSavesToComplete(t *testing.T) {
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
cmd := exec.Command("pidof", "hishtory")
|
cmd := exec.Command("pidof", "hishtory")
|
||||||
|
@ -99,7 +99,7 @@ func RunTestServer() func() {
|
|||||||
if strings.Contains(stderr.String()+stdout.String(), "failed to") {
|
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()))
|
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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user