Skip to content

Commit

Permalink
add libvips version and arch to reference image check
Browse files Browse the repository at this point in the history
  • Loading branch information
tonimelisma committed Nov 8, 2022
1 parent 23d7e28 commit 482a880
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions vips/image_golden_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ func goldenCreateTest(
require.NoError(t, err)

img2, err := createFromBuffer(buf2)
require.NoError(t, err)

err = exec(img2)
require.NoError(t, err)
Expand All @@ -1036,24 +1037,25 @@ func goldenCreateTest(
func getEnvironment() string {
switch runtime.GOOS {
case "windows":
return "windows"
// Missing Windows version detection. Windows is not a supported CI target right now
return "windows_" + runtime.GOARCH + "_libvips-" + Version
case "darwin":
out, err := exec.Command("sw_vers", "-productVersion").Output()
if err != nil {
return "macos-unknown"
return "macos-unknown_" + runtime.GOARCH + "_libvips-" + Version
}
majorVersion := strings.Split(strings.TrimSpace(string(out)), ".")[0]
return "macos-" + majorVersion
return "macos-" + majorVersion + "_" + runtime.GOARCH + "_libvips-" + Version
case "linux":
out, err := exec.Command("lsb_release", "-cs").Output()
if err != nil {
return "linux"
return "linux-unknown_" + runtime.GOARCH
}
strout := strings.TrimSuffix(string(out), "\n")
return "linux-" + strout
return "linux-" + strout + "_" + runtime.GOARCH + "_libvips-" + Version
}
// default to linux assets otherwise
return "linux"
// default to unknown assets otherwise
return "unknown_" + runtime.GOARCH + "_libvips-" + Version
}

func assertGoldenMatch(t *testing.T, file string, buf []byte, format ImageType) {
Expand Down

0 comments on commit 482a880

Please sign in to comment.