mirror of
https://github.com/ddworken/hishtory.git
synced 2025-04-01 11:58:38 +02:00
Add more tests to testIntegrationWithNewDevice
This commit is contained in:
parent
acef5c0879
commit
add3693967
@ -273,6 +273,15 @@ func testIntegrationWithNewDevice(t *testing.T, tester shellTester) {
|
|||||||
if diff := cmp.Diff(expectedOutput, out); diff != "" {
|
if diff := cmp.Diff(expectedOutput, out); diff != "" {
|
||||||
t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out)
|
t.Fatalf("hishtory export mismatch (-expected +got):\n%s\nout=%#v", diff, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// And test the export for each shell without anything filtered out
|
||||||
|
out = tester.RunInteractiveShell(t, `hishtory export | grep -v 'hishtory init '`)
|
||||||
|
compareGoldens(t, out, "testIntegrationWithNewDevice-"+tester.ShellName())
|
||||||
|
|
||||||
|
// And test the table but with a subset of columns that is static
|
||||||
|
tester.RunInteractiveShell(t, `hishtory config-set displayed-columns Hostname 'Exit Code' Command`)
|
||||||
|
out = tester.RunInteractiveShell(t, `hishtory query | grep -v 'hishtory init '`)
|
||||||
|
compareGoldens(t, out, "testIntegrationWithNewDevice-table"+tester.ShellName())
|
||||||
}
|
}
|
||||||
|
|
||||||
func installHishtory(t *testing.T, tester shellTester, userSecret string) string {
|
func installHishtory(t *testing.T, tester shellTester, userSecret string) string {
|
||||||
|
38
client/lib/goldens/testIntegrationWithNewDevice-bash
Normal file
38
client/lib/goldens/testIntegrationWithNewDevice-bash
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
set -emo pipefail
|
||||||
|
hishtory status
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
ls /a
|
||||||
|
ls /bar
|
||||||
|
ls /foo
|
||||||
|
echo foo
|
||||||
|
echo bar
|
||||||
|
hishtory enable
|
||||||
|
echo thisisrecorded
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query foo
|
||||||
|
echo hello | grep complex | sed s/h/i/g; echo baz && echo "fo 'o"
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query complex
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
set -emo pipefail
|
||||||
|
echo mynewcommand
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
set -emo pipefail
|
||||||
|
echo mynewercommand
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
othercomputer
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory query
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory reupload
|
||||||
|
set -emo pipefail
|
||||||
|
hishtory export | grep -v pipefail | grep -v '/tmp/client install'
|
||||||
|
set -emo pipefail
|
24
client/lib/goldens/testIntegrationWithNewDevice-tablebash
Normal file
24
client/lib/goldens/testIntegrationWithNewDevice-tablebash
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
Hostname Exit Code Command
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory config-set displayed-columns Hostname 'Exit Code' Command
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory export | grep -v pipefail | grep -v '/tmp/client install'
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory reupload
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory query
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
localhost 2 othercomputer
|
||||||
|
ghaction-runner-hostname 0 hishtory query
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 echo mynewercommand
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory query
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory query
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 echo mynewcommand
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
||||||
|
ghaction-runner-hostname 0 hishtory query
|
||||||
|
ghaction-runner-hostname 0 set -emo pipefail
|
Loading…
Reference in New Issue
Block a user