Another attempt at fixing action tests

This commit is contained in:
David Dworken 2022-11-01 12:00:40 -07:00
parent 153e59eff3
commit 5554720451
No known key found for this signature in database
5 changed files with 7 additions and 26 deletions

View File

@ -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)
}

View File

@ -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]>

View File

@ -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

View File

@ -28,4 +28,4 @@ Search Query: > -pipefail
│ │
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

View File

@ -27,4 +27,4 @@ Search Query: > -pipefail
│ │
│ │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘