From 6065068f9b1e2e3e352ba50198ddc74185edf9a8 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Thu, 28 Mar 2024 08:03:04 -0700 Subject: [PATCH] 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 --- client/client_test.go | 19 ++++--------- .../TestTui-ColoredOutput-darwin-21.6.0 | 27 +++++++++++++++++++ .../TestTui-ColoredOutput-darwin-23.3.0 | 27 +++++++++++++++++++ .../TestTui-ColoredOutput-linux-actions | 27 +++++++++++++++++++ ...dOutputWithCustomColorScheme-darwin-21.6.0 | 27 +++++++++++++++++++ ...dOutputWithCustomColorScheme-darwin-23.3.0 | 27 +++++++++++++++++++ ...dOutputWithCustomColorScheme-linux-actions | 27 +++++++++++++++++++ ...loredOutputWithDefaultFilter-darwin-21.6.0 | 27 +++++++++++++++++++ ...loredOutputWithDefaultFilter-darwin-23.3.0 | 27 +++++++++++++++++++ ...loredOutputWithDefaultFilter-linux-actions | 27 +++++++++++++++++++ ...edOutputWithSearch-Highlight-darwin-21.6.0 | 27 +++++++++++++++++++ ...edOutputWithSearch-Highlight-darwin-23.3.0 | 27 +++++++++++++++++++ ...edOutputWithSearch-Highlight-linux-actions | 27 +++++++++++++++++++ ...tTui-ColoredOutputWithSearch-darwin-21.6.0 | 27 +++++++++++++++++++ ...tTui-ColoredOutputWithSearch-darwin-23.3.0 | 27 +++++++++++++++++++ ...tTui-ColoredOutputWithSearch-linux-actions | 27 +++++++++++++++++++ client/testdata/TestTui-DefaultColorScheme | 3 +++ shared/testutils/testutils.go | 13 +++++++++ 18 files changed, 426 insertions(+), 14 deletions(-) create mode 100644 client/testdata/TestTui-ColoredOutput-darwin-21.6.0 create mode 100644 client/testdata/TestTui-ColoredOutput-darwin-23.3.0 create mode 100644 client/testdata/TestTui-ColoredOutput-linux-actions create mode 100644 client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions create mode 100644 client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0 create mode 100644 client/testdata/TestTui-ColoredOutputWithSearch-linux-actions create mode 100644 client/testdata/TestTui-DefaultColorScheme diff --git a/client/client_test.go b/client/client_test.go index eb0edbb..660b871 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -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) { diff --git a/client/testdata/TestTui-ColoredOutput-darwin-21.6.0 b/client/testdata/TestTui-ColoredOutput-darwin-21.6.0 new file mode 100644 index 0000000..cc84625 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutput-darwin-21.6.0 @@ -0,0 +1,27 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutput-darwin-23.3.0 b/client/testdata/TestTui-ColoredOutput-darwin-23.3.0 new file mode 100644 index 0000000..cc84625 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutput-darwin-23.3.0 @@ -0,0 +1,27 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutput-linux-actions b/client/testdata/TestTui-ColoredOutput-linux-actions new file mode 100644 index 0000000..285ff8f --- /dev/null +++ b/client/testdata/TestTui-ColoredOutput-linux-actions @@ -0,0 +1,27 @@ +Search Query: > ls + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ localhost /tmp/ Oct 17 2022 21:43:16 PDT 3s 2 ls ~/ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0 b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0 new file mode 100644 index 0000000..0975e62 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-21.6.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0 b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0 new file mode 100644 index 0000000..0975e62 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-darwin-23.3.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions new file mode 100644 index 0000000..37a7928 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithCustomColorScheme-linux-actions @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0 b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0 new file mode 100644 index 0000000..ac776da --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-21.6.0 @@ -0,0 +1,27 @@ +Search Query: [exit_code:0] ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0 b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0 new file mode 100644 index 0000000..ac776da --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-darwin-23.3.0 @@ -0,0 +1,27 @@ +Search Query: [exit_code:0] ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions new file mode 100644 index 0000000..94838e1 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithDefaultFilter-linux-actions @@ -0,0 +1,27 @@ +Search Query: [exit_code:0] ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0 b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0 new file mode 100644 index 0000000..96c2fcc --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-21.6.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0 b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0 new file mode 100644 index 0000000..96c2fcc --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-darwin-23.3.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions new file mode 100644 index 0000000..cbf9bb7 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-Highlight-linux-actions @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost  /tmp/  Oct 17 2022 21:43:21 PDT  3s  2  echo 'aaaaaa bbbb'  │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0 b/client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0 new file mode 100644 index 0000000..4d4537d --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-darwin-21.6.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0 b/client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0 new file mode 100644 index 0000000..4d4537d --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-darwin-23.3.0 @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-ColoredOutputWithSearch-linux-actions b/client/testdata/TestTui-ColoredOutputWithSearch-linux-actions new file mode 100644 index 0000000..b39e6d3 --- /dev/null +++ b/client/testdata/TestTui-ColoredOutputWithSearch-linux-actions @@ -0,0 +1,27 @@ +Search Query: > ech  + +┌────────────────────────────────────────────────────────────────────────────────────────────────────────┐ +│ Hostname CWD Timestamp Runtime Exit Code Command │ +│────────────────────────────────────────────────────────────────────────────────────────────────────────│ +│ localhost /tmp/ Oct 17 2022 21:43:21 PDT 3s 2 echo 'aaaaaa bbbb' │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +│ │ +└────────────────────────────────────────────────────────────────────────────────────────────────────────┘ +hiSHtory: Search your shell history  • ctrl+h help  \ No newline at end of file diff --git a/client/testdata/TestTui-DefaultColorScheme b/client/testdata/TestTui-DefaultColorScheme new file mode 100644 index 0000000..0df54e4 --- /dev/null +++ b/client/testdata/TestTui-DefaultColorScheme @@ -0,0 +1,3 @@ +selected-text: #ffff99 +selected-background: #3300ff +border-color: #585858 diff --git a/shared/testutils/testutils.go b/shared/testutils/testutils.go index 163ce69..35a4283 100644 --- a/shared/testutils/testutils.go +++ b/shared/testutils/testutils.go @@ -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[:]) +}