Add additional assertion to presaving test to make it a stronger test, and to help debug a test failure that only reproduces on github actions

This commit is contained in:
David Dworken 2023-09-26 22:17:32 -07:00
parent d0712f84c6
commit bed3fd3eb4
No known key found for this signature in database

View File

@ -2117,6 +2117,13 @@ func testPresaving(t *testing.T, tester shellTester) {
out = tester.RunInteractiveShell(t, ` hishtory query sleep 13371337 -export -tquery`)
testutils.CompareGoldens(t, out, "testPresaving-query")
// And that all the other commands do to
out = tester.RunInteractiveShell(t, ` hishtory export -hishtory -table_sizing -pipefail`)
expectedOutput = "sleep 13371337\nls /\nsleep 0.5\n"
if diff := cmp.Diff(expectedOutput, out); diff != "" {
t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out)
}
// And then redact it from device2
tester.RunInteractiveShell(t, ` HISHTORY_REDACT_FORCE=true hishtory redact sleep 13371337`)