Enable some previously disabled tests that I think should now pass on macos

This commit is contained in:
David Dworken 2022-04-18 23:07:39 -07:00
parent 5e25a5bac8
commit 62c29dc68c

View File

@ -121,6 +121,7 @@ func TestParameterized(t *testing.T) {
t.Run("testIntegrationWithNewDevice/"+tester.ShellName(), func(t *testing.T) { testIntegrationWithNewDevice(t, tester) })
t.Run("testHishtoryBackgroundSaving/"+tester.ShellName(), func(t *testing.T) { testHishtoryBackgroundSaving(t, tester) })
t.Run("testDisplayTable/"+tester.ShellName(), func(t *testing.T) { testDisplayTable(t, tester) })
t.Run("testTableDisplayCwd/"+tester.ShellName(), func(t *testing.T) { testTableDisplayCwd(t, tester) })
t.Run("testTimestampsAreReasonablyCorrect/"+tester.ShellName(), func(t *testing.T) { testTimestampsAreReasonablyCorrect(t, tester) })
}
}
@ -433,13 +434,10 @@ hishtory disable`)
}
// Query based on after: and cwd:
// TODO: This fails on macos for some reason
if !(runtime.GOOS == "darwin" && os.Getenv("GITHUB_ACTIONS") != "") {
out = hishtoryQuery(t, tester, `after:1980-07-02 cwd:/tmp`)
if strings.Count(out, "\n") != 3 {
t.Fatalf("hishtory query has the wrong number of lines=%d, out=%#v", strings.Count(out, "\n"), out)
}
}
// Query based on after: that returns no results
out = hishtoryQuery(t, tester, `after:2120-07-02 cwd:/tmp`)
@ -521,11 +519,6 @@ hishtory disable`)
}
func testUpdate(t *testing.T, tester shellTester) {
if runtime.GOOS != "linux" {
// TODO: Once updates work for non-linux platforms, remove this
t.Skip()
}
// Set up
defer shared.BackupAndRestore(t)()
userSecret := installHishtory(t, tester, "")
@ -565,14 +558,11 @@ func testUpdate(t *testing.T, tester shellTester) {
}
// Check that the history was preserved after the update
if tester.ShellName() == "bash" {
// TODO
out = tester.RunInteractiveShell(t, "hishtory export | grep -v pipefail | grep -v '/tmp/client install'")
expectedOutput := "echo hello\nhishtory status\nhishtory update\nhishtory update\nhishtory status\n"
if diff := cmp.Diff(expectedOutput, out); diff != "" {
t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out)
}
}
}
func testRepeatedCommandThenQuery(t *testing.T, tester shellTester) {
@ -703,8 +693,6 @@ echo hello2
}
}
// TODO: Timestamps for bash on macos appear to be currently broken, debug this. Example: https://github.com/ddworken/hishtory/runs/6059464342?check_suite_focus=true
func getPidofCommand() string {
if runtime.GOOS == "darwin" {
// MacOS doesn't have pidof by default