mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-16 18:41:03 +01:00
Update TestSortByConsistentTimezone to not use a golden for tquery since it was leading to occasional flakes, and swap it to using a regex. Also add a test for hishtory export as part of the sorting tests.
This commit is contained in:
parent
4c40a8a177
commit
f1e2b8ddbf
@ -2410,9 +2410,11 @@ func TestSortByConsistentTimezone(t *testing.T) {
|
||||
// And check that they're displayed in the correct order
|
||||
out := hishtoryQuery(t, tester, "-pipefail -tablesizing")
|
||||
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-query")
|
||||
out = tester.RunInteractiveShell(t, `hishtory export -pipefail -tablesizing`)
|
||||
testutils.CompareGoldens(t, out, "TestSortByConsistentTimezone-export")
|
||||
out = captureTerminalOutput(t, tester, []string{"hishtory SPACE tquery SPACE -pipefail SPACE -tablesizing ENTER"})
|
||||
out = strings.TrimSpace(strings.Split(out, "hishtory tquery")[1])
|
||||
testutils.CompareGoldens(t, out, fmt.Sprintf("TestSortByConsistentTimezone-tquery-isAction=%v", testutils.IsGithubAction()))
|
||||
require.Regexp(t, regexp.MustCompile(`Timestamp[\s\S]*Command[\s\S]*Apr 16 2022 01:36:26 PDT[\s\S]*third_entry[\s\S]*Apr 16 2022 01:19:46 PDT[\s\S]*second_entry[\s\S]*Apr 16 2022 01:03:06 PDT[\s\S]*first_entry`), out)
|
||||
}
|
||||
|
||||
func TestZDotDir(t *testing.T) {
|
||||
|
3
client/lib/goldens/TestSortByConsistentTimezone-export
Normal file
3
client/lib/goldens/TestSortByConsistentTimezone-export
Normal file
@ -0,0 +1,3 @@
|
||||
first_entry
|
||||
second_entry
|
||||
third_entry
|
@ -1,31 +0,0 @@
|
||||
-pipefail -tablesizing
|
||||
|
||||
|
||||
|
||||
Search Query: > -pipefail -tablesizing
|
||||
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Hostname CWD Timestamp Runtime Exit Code Command │
|
||||
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ localhost /tmp/ Apr 16 2022 01:36:26 PDT 1s 2 third_entry │
|
||||
│ localhost /tmp/ Apr 16 2022 01:19:46 PDT 1s 2 second_entry │
|
||||
│ localhost /tmp/ Apr 16 2022 01:03:06 PDT 1s 2 first_entry │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
hiSHtory: Search your shell history • ctrl+h help
|
@ -1,31 +0,0 @@
|
||||
-pipefail -tablesizing
|
||||
|
||||
|
||||
|
||||
Search Query: > -pipefail -tablesizing
|
||||
|
||||
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
│ Hostname CWD Timestamp Runtime Exit Code Command │
|
||||
│────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ localhost /tmp/ Apr 16 2022 01:36:26 PDT 1s 2 third_entry │
|
||||
│ localhost /tmp/ Apr 16 2022 01:19:46 PDT 1s 2 second_entry │
|
||||
│ localhost /tmp/ Apr 16 2022 01:03:06 PDT 1s 2 first_entry │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
hiSHtory: Search your shell history • ctrl+h help
|
Loading…
Reference in New Issue
Block a user