diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 54427d1..72eb9ec 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -29,5 +29,5 @@ jobs: brew install fish tmux bash || true export TZ='America/Los_Angeles' # Force the time zone so that test output is consistent sudo chmod 0755 -R /usr/share/zsh/ || true # Work around a weird bug where zsh on ubuntu actiosn gives that diretory 0777 which makes zsh refuse to start - sudo hostname github-action-runner # Set a consistent hostname so we can run tests that depend on it + sudo hostname ghaction-runner-hostname # Set a consistent hostname so we can run tests that depend on it make test diff --git a/client/client_test.go b/client/client_test.go index 4a4051d..1aab972 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1724,7 +1724,16 @@ func TestFish(t *testing.T) { } } +func normalizeHostnames(data string) string { + hostnames := []string{"Davids-MacBook-Air.local", "ghaction-runner-hostname"} + for _, hostname := range hostnames { + data = strings.ReplaceAll(data, hostname, "ghaction-runner-hostname") + } + return data +} + func compareGoldens(t *testing.T, out, goldenName string) { + out = normalizeHostnames(out) goldenPath := path.Join("client/lib/goldens/", goldenName) expected, err := os.ReadFile(goldenPath) if err != nil { diff --git a/client/lib/goldens/testControlR-customColumn b/client/lib/goldens/testControlR-customColumn index ad7d93b..c2b9578 100644 --- a/client/lib/goldens/testControlR-customColumn +++ b/client/lib/goldens/testControlR-customColumn @@ -3,7 +3,7 @@ Search Query: > -pipefail ┌─────────────────────────────────────────────────────────────────────────────┐ │ Hostname Exit Code Command foo │ │─────────────────────────────────────────────────────────────────────────────│ -│ Davids-MacBook-Air.local 0 ls / foo │ +│ ghaction-runner-hostname 0 ls / foo │ │ localhost 2 echo 'bar' & │ │ localhost 2 echo 'aaaaaa bbbb' │ │ localhost 2 ls ~/bar/ │ diff --git a/client/lib/goldens/testControlR-fish-Disabled b/client/lib/goldens/testControlR-fish-Disabled index e517824..1e046d4 100644 --- a/client/lib/goldens/testControlR-fish-Disabled +++ b/client/lib/goldens/testControlR-fish-Disabled @@ -1,3 +1,3 @@ Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish -david@Davids-MacBook-Air ~/c/hishtory (column)> \ No newline at end of file +david@Davids-MacBook-Air ~/c/hishtory (master)> \ No newline at end of file diff --git a/client/lib/goldens/testDisplayTable-customColumns b/client/lib/goldens/testDisplayTable-customColumns index 4e71f2d..2942716 100644 --- a/client/lib/goldens/testDisplayTable-customColumns +++ b/client/lib/goldens/testDisplayTable-customColumns @@ -1,4 +1,4 @@ Hostname Command -Davids-MacBook-Air.local hishtory query table +ghaction-runner-hostname hishtory query table localhost table_cmd2 localhost table_cmd1 diff --git a/client/lib/goldens/testDisplayTable-customColumns-2 b/client/lib/goldens/testDisplayTable-customColumns-2 index 0468a0e..bcbe194 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-2 +++ b/client/lib/goldens/testDisplayTable-customColumns-2 @@ -1,4 +1,4 @@ Hostname Exit Code Command -Davids-MacBook-Air.local 0 hishtory query table +ghaction-runner-hostname 0 hishtory query table 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 06da840..e019561 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-3 +++ b/client/lib/goldens/testDisplayTable-customColumns-3 @@ -1,4 +1,4 @@ Hostname Exit Code Command CWD -Davids-MacBook-Air.local 0 hishtory query table ~/code/hishtory +ghaction-runner-hostname 0 hishtory query table ~/code/hishtory 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 3a7f861..69da0c8 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand +++ b/client/lib/goldens/testDisplayTable-customColumns-multiLineCommand @@ -1,5 +1,5 @@ Hostname Exit Code Command CWD -Davids-MacBook-Air.local 0 hishtory query table ~/code/hishtory +ghaction-runner-hostname 0 hishtory query table ~/code/hishtory localhost 2 while : /tmp/ do ls /table/ diff --git a/client/lib/goldens/testDisplayTable-customColumns-trulyCustom b/client/lib/goldens/testDisplayTable-customColumns-trulyCustom index 3693617..b77b658 100644 --- a/client/lib/goldens/testDisplayTable-customColumns-trulyCustom +++ b/client/lib/goldens/testDisplayTable-customColumns-trulyCustom @@ -1,7 +1,7 @@ Hostname Exit Code Command CWD foo -Davids-MacBook-Air.local 0 echo table-2 ~/code/hishtory aaaaaaaaaaaaa -Davids-MacBook-Air.local 0 echo table-1 ~/code/hishtory aaaaaaaaaaaaa -Davids-MacBook-Air.local 0 hishtory query table ~/code/hishtory +ghaction-runner-hostname 0 echo table-2 ~/code/hishtory aaaaaaaaaaaaa +ghaction-runner-hostname 0 echo table-1 ~/code/hishtory aaaaaaaaaaaaa +ghaction-runner-hostname 0 hishtory query table ~/code/hishtory localhost 2 while : /tmp/ do ls /table/