From 482a880911e5f96cd496ed34b2a6644b2fa28919 Mon Sep 17 00:00:00 2001 From: Toni Melisma <59022391+tonimelisma@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:23:39 -0800 Subject: [PATCH] add libvips version and arch to reference image check --- vips/image_golden_test.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vips/image_golden_test.go b/vips/image_golden_test.go index 08c598b6..200cfd4a 100644 --- a/vips/image_golden_test.go +++ b/vips/image_golden_test.go @@ -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) @@ -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) {