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:
David Dworken
2024-03-28 08:03:04 -07:00
committed by GitHub
parent 2979205ee1
commit 6065068f9b
18 changed files with 426 additions and 14 deletions

View File

@ -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[:])
}