mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-11 16:58:47 +01:00
Normalize hostnames to attempt to get tests to pass in github actions
This commit is contained in:
parent
38ca02b961
commit
189f183d69
2
.github/workflows/go-test.yml
vendored
2
.github/workflows/go-test.yml
vendored
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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/ │
|
||||
|
@ -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)>
|
||||
david@Davids-MacBook-Air ~/c/hishtory (master)>
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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/
|
||||
|
@ -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/
|
||||
|
@ -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/
|
||||
|
Loading…
Reference in New Issue
Block a user