More test fixes

This commit is contained in:
David Dworken 2023-11-19 02:21:43 -08:00
parent be1cd75550
commit 40caf8dac7
2 changed files with 10 additions and 8 deletions

View File

@ -177,6 +177,7 @@ yes | hishtory init `+userSecret)
for _, item := range expected {
require.Contains(t, out, item, "output is missing expected item")
if strings.Count(out, item) != 1 {
fmt.Println("TODO: Debugging: out=" + out)
t.Fatalf("output has %#v in it multiple times! out=%#v", item, out)
}
}
@ -478,7 +479,7 @@ hishtory disable`)
manuallySubmitHistoryEntry(t, userSecret, entry)
out = hishtoryQuery(t, tester, `-echo -install -pipefail`)
require.NotContains(t, out, "echo")
if strings.Count(out, "\n") != 4 {
if strings.Count(out, "\n") != 6 {
t.Fatalf("hishtory query has the wrong number of lines=%d, out=%#v", strings.Count(out, "\n"), out)
}

View File

@ -1,8 +1,9 @@
CWD Hostname Exit Code Command
/ ghaction-runner-hostname 0 hishtory config-set displayed-columns CWD Hostname 'Exit Code' Command
/ ghaction-runner-hostname 0 fish
/ ghaction-runner-hostname 0 echo foo
/ ghaction-runner-hostname 0 ls /tmp/ &
/ ghaction-runner-hostname 0 echo "foo"
/ ghaction-runner-hostname 0 echo bar
/ ghaction-runner-hostname 0 echo foo
/ ghaction-runner-hostname 0 hishtory config-set displayed-columns CWD Hostname 'Exit Code' Command
/ ghaction-runner-hostname 0 exit
/ ghaction-runner-hostname 0 echo foo
/ ghaction-runner-hostname 0 fish
/ ghaction-runner-hostname 0 ls /tmp/ &
/ ghaction-runner-hostname 0 echo "foo"
/ ghaction-runner-hostname 0 echo bar
/ ghaction-runner-hostname 0 echo foo