Normalize hostnames to attempt to get tests to pass in github actions

This commit is contained in:
David Dworken
2022-10-27 23:30:09 -07:00
parent 38ca02b961
commit 189f183d69
9 changed files with 19 additions and 10 deletions

View File

@ -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 {