From 6ad60f4e5811c77e879c96b93f0a56ecfd845973 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sat, 29 Oct 2022 18:34:16 -0700 Subject: [PATCH] Move up the hishtory disable so as to avoid recording the query --- client/client_test.go | 2 +- .../goldens/testDisplayTable-customColumns | 7 +++---- .../goldens/testDisplayTable-customColumns-2 | 7 +++---- .../goldens/testDisplayTable-customColumns-3 | 7 +++---- ...isplayTable-customColumns-multiLineCommand | 15 +++++++-------- ...testDisplayTable-customColumns-trulyCustom | 19 +++++++++---------- 6 files changed, 26 insertions(+), 31 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index bd0c92c..e6ce7f6 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -998,11 +998,11 @@ func testDisplayTable(t *testing.T, tester shellTester) { manuallySubmitHistoryEntry(t, userSecret, entry2) // Query and check the table + tester.RunInteractiveShell(t, ` hishtory disable`) out := hishtoryQuery(t, tester, "table") compareGoldens(t, out, "testDisplayTable-defaultColumns") // Adjust the columns that should be displayed - tester.RunInteractiveShell(t, ` hishtory disable`) tester.RunInteractiveShell(t, `hishtory config-set displayed-columns Hostname Command`) // And check the table again diff --git a/client/lib/goldens/testDisplayTable-customColumns b/client/lib/goldens/testDisplayTable-customColumns index 2942716..fd4d4d0 100644 --- a/client/lib/goldens/testDisplayTable-customColumns +++ b/client/lib/goldens/testDisplayTable-customColumns @@ -1,4 +1,3 @@ -Hostname Command -ghaction-runner-hostname hishtory query table -localhost table_cmd2 -localhost table_cmd1 +Hostname Command +localhost table_cmd2 +localhost table_cmd1 diff --git a/client/lib/goldens/testDisplayTable-customColumns-2 b/client/lib/goldens/testDisplayTable-customColumns-2 index bcbe194..3b671a2 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-2 +++ b/client/lib/goldens/testDisplayTable-customColumns-2 @@ -1,4 +1,3 @@ -Hostname Exit Code Command -ghaction-runner-hostname 0 hishtory query table -localhost 3 table_cmd2 -localhost 2 table_cmd1 +Hostname Exit Code Command +localhost 3 table_cmd2 +localhost 2 table_cmd1 diff --git a/client/lib/goldens/testDisplayTable-customColumns-3 b/client/lib/goldens/testDisplayTable-customColumns-3 index e019561..f9ae0f7 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-3 +++ b/client/lib/goldens/testDisplayTable-customColumns-3 @@ -1,4 +1,3 @@ -Hostname Exit Code Command CWD -ghaction-runner-hostname 0 hishtory query table ~/code/hishtory -localhost 3 table_cmd2 ~/foo/ -localhost 2 table_cmd1 /tmp/ +Hostname Exit Code Command CWD +localhost 3 table_cmd2 ~/foo/ +localhost 2 table_cmd1 /tmp/ diff --git a/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand b/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand index 69da0c8..4b874c2 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand +++ b/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand @@ -1,8 +1,7 @@ -Hostname Exit Code Command CWD -ghaction-runner-hostname 0 hishtory query table ~/code/hishtory -localhost 2 while : /tmp/ - do - ls /table/ - done -localhost 3 table_cmd2 ~/foo/ -localhost 2 table_cmd1 /tmp/ +Hostname Exit Code Command CWD +localhost 2 while : /tmp/ + do + ls /table/ + done +localhost 3 table_cmd2 ~/foo/ +localhost 2 table_cmd1 /tmp/ diff --git a/client/lib/goldens/testDisplayTable-customColumns-trulyCustom b/client/lib/goldens/testDisplayTable-customColumns-trulyCustom index e3fab00..13107ac 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-trulyCustom +++ b/client/lib/goldens/testDisplayTable-customColumns-trulyCustom @@ -1,10 +1,9 @@ -Hostname Exit Code Command CWD foo -ghaction-runner-hostname 0 echo table-2 / aaaaaaaaaaaaa -ghaction-runner-hostname 0 echo table-1 / aaaaaaaaaaaaa -ghaction-runner-hostname 0 hishtory query table ~/code/hishtory -localhost 2 while : /tmp/ - do - ls /table/ - done -localhost 3 table_cmd2 ~/foo/ -localhost 2 table_cmd1 /tmp/ +Hostname Exit Code Command CWD foo +ghaction-runner-hostname 0 echo table-2 / aaaaaaaaaaaaa +ghaction-runner-hostname 0 echo table-1 / aaaaaaaaaaaaa +localhost 2 while : /tmp/ + do + ls /table/ + done +localhost 3 table_cmd2 ~/foo/ +localhost 2 table_cmd1 /tmp/