mirror of
https://github.com/ddworken/hishtory.git
synced 2025-02-02 11:39:24 +01:00
Enable colored golden tests for linux (#184)
* Enable golden tests for linux and ensure all goldens get saved as outputs * Swap in OS specific goldens * Update colored goldens to take into account OS version, since different macos versions have different behavior here * Update goldens * Re-enable golden tests * Add missing golden * Empty commit * Remove linux kernel version from OS name
This commit is contained in:
parent
2979205ee1
commit
6065068f9b
@ -1857,15 +1857,6 @@ func testTui_defaultFilter(t *testing.T) {
|
||||
}
|
||||
|
||||
func testTui_color(t *testing.T) {
|
||||
if runtime.GOOS == "linux" {
|
||||
// For some reason, this test fails on linux. Since this test isn't critical and is expected to be
|
||||
// flaky, we can just skip it on linux.
|
||||
t.Skip()
|
||||
} else if testutils.IsGithubAction() {
|
||||
// For some reason this started randomly failing on GH without any associated change (likely due to some invisible change in Actions infra). Disabling while I debug this.
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
// Setup
|
||||
defer testutils.BackupAndRestore(t)()
|
||||
tester, _, _ := setupTestTui(t, Online)
|
||||
@ -1875,19 +1866,19 @@ func testTui_color(t *testing.T) {
|
||||
// from inspection and primarily servers to detect unintended changes in hishtory's output.
|
||||
out := captureTerminalOutputComplex(t, TmuxCaptureConfig{tester: tester, complexCommands: []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}}, includeEscapeSequences: true})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutput")
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutput-"+runtime.GOOS+"-"+testutils.GetOsVersion(t))
|
||||
|
||||
// And the same once a search query has been typed in
|
||||
out = captureTerminalOutputComplex(t, TmuxCaptureConfig{tester: tester, complexCommands: []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, includeEscapeSequences: true})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch")
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch-"+runtime.GOOS+"-"+testutils.GetOsVersion(t))
|
||||
|
||||
// And one more time with highlight-matches
|
||||
tester.RunInteractiveShell(t, ` hishtory config-set highlight-matches true`)
|
||||
require.Equal(t, "true", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get highlight-matches`)))
|
||||
out = captureTerminalOutputComplex(t, TmuxCaptureConfig{tester: tester, complexCommands: []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, includeEscapeSequences: true})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch-Highlight")
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithSearch-Highlight-"+runtime.GOOS+"-"+testutils.GetOsVersion(t))
|
||||
|
||||
// And one more time with customized colors
|
||||
testutils.CompareGoldens(t, tester.RunInteractiveShell(t, ` hishtory config-get color-scheme`), "TestTui-DefaultColorScheme")
|
||||
@ -1896,7 +1887,7 @@ func testTui_color(t *testing.T) {
|
||||
tester.RunInteractiveShell(t, ` hishtory config-set color-scheme border-color #f54272`)
|
||||
out = captureTerminalOutputComplex(t, TmuxCaptureConfig{tester: tester, complexCommands: []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, includeEscapeSequences: true})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithCustomColorScheme")
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithCustomColorScheme-"+runtime.GOOS+"-"+testutils.GetOsVersion(t))
|
||||
|
||||
// And one more time with a default filter
|
||||
require.Equal(t, "\"\"", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get default-filter`)))
|
||||
@ -1904,7 +1895,7 @@ func testTui_color(t *testing.T) {
|
||||
require.Equal(t, "\"exit_code:0\"", strings.TrimSpace(tester.RunInteractiveShell(t, `hishtory config-get default-filter`)))
|
||||
out = captureTerminalOutputComplex(t, TmuxCaptureConfig{tester: tester, complexCommands: []TmuxCommand{{Keys: "hishtory SPACE tquery ENTER"}, {Keys: "ech"}}, includeEscapeSequences: true})
|
||||
out = stripTuiCommandPrefix(t, out)
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithDefaultFilter")
|
||||
testutils.CompareGoldens(t, out, "TestTui-ColoredOutputWithDefaultFilter-"+runtime.GOOS+"-"+testutils.GetOsVersion(t))
|
||||
}
|
||||
|
||||
func testTui_delete(t *testing.T) {
|
||||
|
27
client/testdata/TestTui-ColoredOutput-darwin-21.6.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutput-darwin-21.6.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [7m[39ml[0m[90ms[39m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutput-darwin-23.3.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutput-darwin-23.3.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [7m[39ml[0m[90ms[39m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutput-linux-actions
vendored
Normal file
27
client/testdata/TestTui-ColoredOutput-linux-actions
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [7m[39ml[0m[90m[49ms[39m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[92m[104m localhost [39m [92m/tmp/ [39m [92mOct 17 2022 21:43:21 PDT [39m [92m3s [39m [92m2 [39m [1m[92mech[0m[92m[104mo 'aaaaaa bbbb' [39m [91m[49m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[92m[104m localhost [39m [92m/tmp/ [39m [92mOct 17 2022 21:43:21 PDT [39m [92m3s [39m [92m2 [39m [1m[92mech[0m[92m[104mo 'aaaaaa bbbb' [39m [91m[49m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m[39m[49m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[92m[104m localhost [39m [92m/tmp/ [39m [92mOct 17 2022 21:43:21 PDT [39m [92m3s [39m [92m2 [39m [1m[92mech[0m[92m[104mo 'aaaaaa bbbb' [39m [91m[49m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m[exit_code:0] [39mech[7m [0m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m[exit_code:0] [39mech[7m [0m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m[exit_code:0] [39mech[7m [0m[39m[49m
|
||||
|
||||
[91m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[91m│[39m Hostname CWD Timestamp Runtime Exit Code Command [91m│[39m
|
||||
[91m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m│[39m [91m│[39m
|
||||
[91m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost [39m [93m/tmp/ [39m [93mOct 17 2022 21:43:21 PDT [39m [93m3s [39m [93m2 [39m [1m[93mech[0m[93m[104mo 'aaaaaa bbbb' [39m [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost [39m [93m/tmp/ [39m [93mOct 17 2022 21:43:21 PDT [39m [93m3s [39m [93m2 [39m [1m[93mech[0m[93m[104mo 'aaaaaa bbbb' [39m [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m[39m[49m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost [39m [93m/tmp/ [39m [93mOct 17 2022 21:43:21 PDT [39m [93m3s [39m [93m2 [39m [1m[93mech[0m[93m[104mo 'aaaaaa bbbb' [39m [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
27
client/testdata/TestTui-ColoredOutputWithSearch-linux-actions
vendored
Normal file
27
client/testdata/TestTui-ColoredOutputWithSearch-linux-actions
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
Search Query: [90m> [39mech[7m [0m[39m[49m
|
||||
|
||||
[90m┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐[39m
|
||||
[90m│[39m Hostname CWD Timestamp Runtime Exit Code Command [90m│[39m
|
||||
[90m│────────────────────────────────────────────────────────────────────────────────────────────────────────│[39m
|
||||
[90m│[93m[104m localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' [90m[49m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m│[39m [90m│[39m
|
||||
[90m└────────────────────────────────────────────────────────────────────────────────────────────────────────┘[39m
|
||||
[90mhiSHtory: Search your shell history[39m [90m • ctrl+h[39m [90mhelp [39m
|
3
client/testdata/TestTui-DefaultColorScheme
vendored
Normal file
3
client/testdata/TestTui-DefaultColorScheme
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
selected-text: #ffff99
|
||||
selected-background: #3300ff
|
||||
border-color: #585858
|
@ -19,6 +19,7 @@ import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -404,3 +405,15 @@ func normalizeHostnames(data string) string {
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
func GetOsVersion(t *testing.T) string {
|
||||
if runtime.GOOS == "linux" {
|
||||
return "actions"
|
||||
}
|
||||
var uts unix.Utsname
|
||||
if err := unix.Uname(&uts); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return unix.ByteSliceToString(uts.Release[:])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user