mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-22 22:28:51 +01:00
Invert condition so that a bunch of golden tests only run on actions, since that is now our primary testing environment (#159)
* Invert condition so that a bunch of golden tests only run on actions, since that is now our primary testing environment * Update goldens to match them on GH actions * Update goldens to split them based on OS so they can run on GH actions * Add runtime.GOOS to golden names * Update goldens that are now split by OS * Update another test to fork on OS * Update shell exclusion to properly exclude fish * More golden updates * Add more goldens * More goldens
This commit is contained in:
parent
040669a823
commit
29ba7bc272
@ -1940,8 +1940,8 @@ func testTui_general(t *testing.T, onlineStatus OnlineStatus) {
|
||||
"Escape",
|
||||
})
|
||||
require.NotContains(t, out, "Search Query:")
|
||||
if !testutils.IsGithubAction() {
|
||||
testutils.CompareGoldens(t, out, "TestTui-Exit")
|
||||
if testutils.IsGithubAction() {
|
||||
testutils.CompareGoldens(t, out, "TestTui-Exit-"+runtime.GOOS)
|
||||
}
|
||||
|
||||
// Test opening the help page
|
||||
@ -2147,9 +2147,13 @@ func testControlR(t *testing.T, tester shellTester, shellName string, onlineStat
|
||||
require.NotContains(t, out, "Search Query", "hishtory is showing a table even after control-c?")
|
||||
require.NotContains(t, out, "─────", "hishtory is showing a table even after control-c?")
|
||||
require.NotContains(t, out, "Exit Code", "hishtory is showing a table even after control-c?")
|
||||
if !testutils.IsGithubAction() {
|
||||
// This bit is broken on actions since actions run as a different user
|
||||
testutils.CompareGoldens(t, out, "testControlR-ControlC-"+shellName)
|
||||
if testutils.IsGithubAction() {
|
||||
if shellName == "fish" {
|
||||
require.Contains(t, out, "Welcome to fish, the friendly interactive shell")
|
||||
require.Contains(t, out, "> echo ")
|
||||
} else {
|
||||
testutils.CompareGoldens(t, out, "testControlR-ControlC-"+shellName+"-"+runtime.GOOS)
|
||||
}
|
||||
}
|
||||
|
||||
// Disable control-r
|
||||
@ -2159,9 +2163,8 @@ func testControlR(t *testing.T, tester shellTester, shellName string, onlineStat
|
||||
require.NotContains(t, out, "Search Query", "hishtory overrode control-r even when this was disabled?")
|
||||
require.NotContains(t, out, "─────", "hishtory overrode control-r even when this was disabled?")
|
||||
require.NotContains(t, out, "Exit Code", "hishtory overrode control-r even when this was disabled?")
|
||||
if !testutils.IsGithubAction() {
|
||||
// This bit is broken on actions since actions run as a different user
|
||||
testutils.CompareGoldens(t, out, "testControlR-"+shellName+"-Disabled")
|
||||
if testutils.IsGithubAction() && shellName != "fish" {
|
||||
testutils.CompareGoldens(t, out, "testControlR-"+shellName+"-Disabled-"+runtime.GOOS)
|
||||
}
|
||||
|
||||
// Re-enable control-r
|
||||
@ -2186,8 +2189,8 @@ func testControlR(t *testing.T, tester shellTester, shellName string, onlineStat
|
||||
// Check that we can select it correctly
|
||||
out = stripShellPrefix(captureTerminalOutputWithShellName(t, tester, shellName, []string{"C-R", "Slah", "Enter"}))
|
||||
require.Contains(t, out, "-Slah", "out has unexpected output missing the selected row")
|
||||
if !testutils.IsGithubAction() {
|
||||
testutils.CompareGoldens(t, out, "testControlR-SelectMultiline-"+shellName)
|
||||
if testutils.IsGithubAction() && shellName != "fish" {
|
||||
testutils.CompareGoldens(t, out, "testControlR-SelectMultiline-"+shellName+"-"+runtime.GOOS)
|
||||
}
|
||||
|
||||
// Assert there are no leaked connections
|
||||
@ -2441,13 +2444,13 @@ echo bar`)
|
||||
testutils.CompareGoldens(t, out, "testUninstall-post-uninstall")
|
||||
|
||||
// And check again, but in a way that shows the full terminal output
|
||||
if !testutils.IsGithubAction() {
|
||||
if testutils.IsGithubAction() {
|
||||
out = captureTerminalOutput(t, tester, []string{
|
||||
"echo SPACE foo ENTER",
|
||||
"hishtory ENTER",
|
||||
"echo SPACE bar ENTER",
|
||||
})
|
||||
testutils.CompareGoldens(t, out, "testUninstall-post-uninstall-"+tester.ShellName())
|
||||
testutils.CompareGoldens(t, out, "testUninstall-post-uninstall-"+tester.ShellName()+"-"+runtime.GOOS)
|
||||
}
|
||||
}
|
||||
|
||||
|
3
client/testdata/TestTui-Exit
vendored
3
client/testdata/TestTui-Exit
vendored
@ -1,3 +0,0 @@
|
||||
david@ghaction-runner-hostname hishtory % hishtory tquery
|
||||
|
||||
david@ghaction-runner-hostname hishtory %
|
3
client/testdata/TestTui-Exit-darwin
vendored
Normal file
3
client/testdata/TestTui-Exit-darwin
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
runner@ghaction-runner-hostname hishtory % hishtory tquery
|
||||
|
||||
runner@ghaction-runner-hostname hishtory %
|
3
client/testdata/TestTui-Exit-linux
vendored
Normal file
3
client/testdata/TestTui-Exit-linux
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
ghaction-runner-hostname% hishtory tquery
|
||||
|
||||
ghaction-runner-hostname%
|
2
client/testdata/testControlR-ControlC-bash
vendored
2
client/testdata/testControlR-ControlC-bash
vendored
@ -1,2 +0,0 @@
|
||||
bash-5.2$ source /Users/david/.bashrc
|
||||
bash-5.2$ echo
|
2
client/testdata/testControlR-ControlC-bash-darwin
vendored
Normal file
2
client/testdata/testControlR-ControlC-bash-darwin
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bash-5.2$ source /Users/runner/.bashrc
|
||||
bash-5.2$ echo
|
2
client/testdata/testControlR-ControlC-bash-linux
vendored
Normal file
2
client/testdata/testControlR-ControlC-bash-linux
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ source /home/runner/.bashrc
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ echo
|
3
client/testdata/testControlR-ControlC-fish
vendored
3
client/testdata/testControlR-ControlC-fish
vendored
@ -1,3 +0,0 @@
|
||||
Welcome to fish, the friendly interactive shell
|
||||
Type help for instructions on how to use fish
|
||||
david@Davids-MacBook-Air ~/c/hishtory (master)> echo 'aaaaaa bbbb'
|
1
client/testdata/testControlR-ControlC-zsh
vendored
1
client/testdata/testControlR-ControlC-zsh
vendored
@ -1 +0,0 @@
|
||||
david@Davids-MacBook-Air hishtory % echo
|
1
client/testdata/testControlR-ControlC-zsh-darwin
vendored
Normal file
1
client/testdata/testControlR-ControlC-zsh-darwin
vendored
Normal file
@ -0,0 +1 @@
|
||||
runner@ghaction-runner-hostname hishtory % echo
|
1
client/testdata/testControlR-ControlC-zsh-linux
vendored
Normal file
1
client/testdata/testControlR-ControlC-zsh-linux
vendored
Normal file
@ -0,0 +1 @@
|
||||
ghaction-runner-hostname% echo
|
2
client/testdata/testControlR-SelectMultiline-bash-darwin
vendored
Normal file
2
client/testdata/testControlR-SelectMultiline-bash-darwin
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bash-5.2$ source /Users/runner/.bashrc
|
||||
bash-5.2$ ls -Slah /
|
2
client/testdata/testControlR-SelectMultiline-bash-linux
vendored
Normal file
2
client/testdata/testControlR-SelectMultiline-bash-linux
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ source /home/runner/.bashrc
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ ls -Slah /
|
@ -1,3 +0,0 @@
|
||||
Welcome to fish, the friendly interactive shell
|
||||
Type help for instructions on how to use fish
|
||||
david@Davids-MacBook-Air ~/c/hishtory (master)> ls -Slah /AppleInternal/
|
3
client/testdata/testControlR-SelectMultiline-zsh-darwin
vendored
Normal file
3
client/testdata/testControlR-SelectMultiline-zsh-darwin
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
runner@ghaction-runner-hostname hishtory % ls \
|
||||
-Slah \
|
||||
/
|
3
client/testdata/testControlR-SelectMultiline-zsh-linux
vendored
Normal file
3
client/testdata/testControlR-SelectMultiline-zsh-linux
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
ghaction-runner-hostname% ls \
|
||||
-Slah \
|
||||
/
|
2
client/testdata/testControlR-bash-Disabled-darwin
vendored
Normal file
2
client/testdata/testControlR-bash-Disabled-darwin
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
bash-5.2$ source /Users/runner/.bashrc
|
||||
(reverse-i-search)`':
|
2
client/testdata/testControlR-bash-Disabled-linux
vendored
Normal file
2
client/testdata/testControlR-bash-Disabled-linux
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ source /home/runner/.bashrc
|
||||
(reverse-i-search)`':
|
3
client/testdata/testControlR-fish-Disabled
vendored
3
client/testdata/testControlR-fish-Disabled
vendored
@ -1,3 +0,0 @@
|
||||
Welcome to fish, the friendly interactive shell
|
||||
Type help for instructions on how to use fish
|
||||
david@Davids-MacBook-Air ~/c/hishtory (master)>
|
2
client/testdata/testControlR-zsh-Disabled-darwin
vendored
Normal file
2
client/testdata/testControlR-zsh-Disabled-darwin
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
runner@ghaction-runner-hostname hishtory %
|
||||
bck-i-search: _
|
2
client/testdata/testControlR-zsh-Disabled-linux
vendored
Normal file
2
client/testdata/testControlR-zsh-Disabled-linux
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
ghaction-runner-hostname%
|
||||
bck-i-search: _
|
@ -1,4 +1,4 @@
|
||||
bash-5.2$ source /Users/david/.bashrc
|
||||
bash-5.2$ source /Users/runner/.bashrc
|
||||
bash-5.2$ echo foo
|
||||
foo
|
||||
bash-5.2$ hishtory
|
8
client/testdata/testUninstall-post-uninstall-bash-linux
vendored
Normal file
8
client/testdata/testUninstall-post-uninstall-bash-linux
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ source /home/runner/.bashrc
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ echo foo
|
||||
foo
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ hishtory
|
||||
hishtory: command not found
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$ echo bar
|
||||
bar
|
||||
runner@ghaction-runner-hostname:~/work/hishtory/hishtory$
|
@ -1,7 +0,0 @@
|
||||
david@Davids-MacBook-Air hishtory % echo foo
|
||||
foo
|
||||
david@Davids-MacBook-Air hishtory % hishtory
|
||||
zsh: command not found: hishtory
|
||||
david@Davids-MacBook-Air hishtory % echo bar
|
||||
bar
|
||||
david@Davids-MacBook-Air hishtory %
|
7
client/testdata/testUninstall-post-uninstall-zsh-darwin
vendored
Normal file
7
client/testdata/testUninstall-post-uninstall-zsh-darwin
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
runner@ghaction-runner-hostname hishtory % echo foo
|
||||
foo
|
||||
runner@ghaction-runner-hostname hishtory % hishtory
|
||||
zsh: command not found: hishtory
|
||||
runner@ghaction-runner-hostname hishtory % echo bar
|
||||
bar
|
||||
runner@ghaction-runner-hostname hishtory %
|
7
client/testdata/testUninstall-post-uninstall-zsh-linux
vendored
Normal file
7
client/testdata/testUninstall-post-uninstall-zsh-linux
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
ghaction-runner-hostname% echo foo
|
||||
foo
|
||||
ghaction-runner-hostname% hishtory
|
||||
zsh: command not found: hishtory
|
||||
ghaction-runner-hostname% echo bar
|
||||
bar
|
||||
ghaction-runner-hostname%
|
Loading…
Reference in New Issue
Block a user