mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-09 23:17:55 +02:00
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:
@ -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[:])
|
||||
}
|
||||
|
Reference in New Issue
Block a user