From 55547204511bed0e2b0e63548316043d14080312 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Tue, 1 Nov 2022 12:00:40 -0700 Subject: [PATCH] Another attempt at fixing action tests --- client/client_test.go | 9 ++++----- client/lib/goldens/TestFish-capturedPane | 18 ------------------ client/lib/goldens/TestFish-table | 2 +- ...testCustomColumns-tquery-bash-isAction=true | 2 +- .../testCustomColumns-tquery-zsh-isAction=true | 2 +- 5 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 client/lib/goldens/TestFish-capturedPane diff --git a/client/client_test.go b/client/client_test.go index b3a361d..35f986f 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1720,16 +1720,15 @@ func TestFish(t *testing.T) { "echo SPACE bar ENTER", "echo SPACE '\"foo\"' ENTER", "SPACE echo SPACE foobar ENTER", - "ls SPACE /bar/ SPACE '&' ENTER", + "ls SPACE /tmp/ SPACE '&' ENTER", }) - if os.Getenv("GITHUB_ACTION") == "" { - // This bit is broken on actions since actions run as a different user - compareGoldens(t, out, "TestFish-capturedPane") + if !strings.Contains(out, "Welcome to fish, the friendly interactive shell") || !strings.Contains(out, "foo") || !strings.Contains(out, "bar") || !strings.Contains(out, "baz") { + t.Fatalf("fish output looks wrong") } // Check export out = tester.RunInteractiveShell(t, `hishtory export | grep -v pipefail | grep -v ps`) - expectedOutput := "echo foo\necho bar\necho \"foo\"\nls /bar/ &\n" + expectedOutput := "echo foo\necho bar\necho \"foo\"\nls /tmp/ &\n" if diff := cmp.Diff(expectedOutput, out); diff != "" { t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out) } diff --git a/client/lib/goldens/TestFish-capturedPane b/client/lib/goldens/TestFish-capturedPane deleted file mode 100644 index 63f5ce3..0000000 --- a/client/lib/goldens/TestFish-capturedPane +++ /dev/null @@ -1,18 +0,0 @@ -Welcome to fish, the friendly interactive shell -Type help for instructions on how to use fish -david@Davids-MacBook-Air /> echo foo -foo -david@Davids-MacBook-Air /> -david@Davids-MacBook-Air /> echo baz -baz -david@Davids-MacBook-Air /> echo bar -bar -david@Davids-MacBook-Air /> echo "foo" -foo -david@Davids-MacBook-Air /> echo foobar -foobar -david@Davids-MacBook-Air /> ls /bar/ & -ls: /bar/: No such file or directory - -fish: Job 1, 'ls /bar/ &' has ended -david@Davids-MacBook-Air / [1]> \ No newline at end of file diff --git a/client/lib/goldens/TestFish-table b/client/lib/goldens/TestFish-table index e2cebcd..3491deb 100644 --- a/client/lib/goldens/TestFish-table +++ b/client/lib/goldens/TestFish-table @@ -1,6 +1,6 @@ CWD Hostname Exit Code Command / ghaction-runner-hostname 0 hishtory config-set displayed-columns CWD Hostname 'Exit Code' Command -/ ghaction-runner-hostname 1 ls /bar/ & +/ ghaction-runner-hostname 0 ls /tmp/ & / ghaction-runner-hostname 0 echo "foo" / ghaction-runner-hostname 0 echo bar / ghaction-runner-hostname 0 echo foo diff --git a/client/lib/goldens/testCustomColumns-tquery-bash-isAction=true b/client/lib/goldens/testCustomColumns-tquery-bash-isAction=true index e9751ec..0b13fb6 100644 --- a/client/lib/goldens/testCustomColumns-tquery-bash-isAction=true +++ b/client/lib/goldens/testCustomColumns-tquery-bash-isAction=true @@ -28,4 +28,4 @@ Search Query: > -pipefail │ │ │ │ │ │ -└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ \ No newline at end of file diff --git a/client/lib/goldens/testCustomColumns-tquery-zsh-isAction=true b/client/lib/goldens/testCustomColumns-tquery-zsh-isAction=true index 841fd3f..59cd668 100644 --- a/client/lib/goldens/testCustomColumns-tquery-zsh-isAction=true +++ b/client/lib/goldens/testCustomColumns-tquery-zsh-isAction=true @@ -27,4 +27,4 @@ Search Query: > -pipefail │ │ │ │ │ │ -└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ \ No newline at end of file