diff --git a/Makefile b/Makefile index 5cd41a213c9..6ab3b2c11ad 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ BOOTSTRAP_CACHE="c7afb99ad" DISTDIR=./dist SNAPSHOTDIR=./snapshot OS=$(shell uname | tr '[:upper:]' '[:lower:]') -SNAPSHOT_BIN=$(shell realpath $(shell pwd)/$(SNAPSHOTDIR)/$(OS)-build_$(OS)_amd64/$(BIN)) +SNAPSHOT_BIN=$(shell realpath $(shell pwd)/$(SNAPSHOTDIR)/$(OS)-build_$(OS)_amd64_v1/$(BIN)) ## Variable assertions @@ -109,7 +109,7 @@ bootstrap-tools: $(TEMPDIR) curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TEMPDIR)/ v1.45.0 curl -sSfL https://raw.githubusercontent.com/wagoodman/go-bouncer/master/bouncer.sh | sh -s -- -b $(TEMPDIR)/ v0.3.0 curl -sSfL https://raw.githubusercontent.com/anchore/chronicle/main/install.sh | sh -s -- -b $(TEMPDIR)/ v0.3.0 - .github/scripts/goreleaser-install.sh -d -b $(TEMPDIR)/ v1.4.1 + .github/scripts/goreleaser-install.sh -d -b $(TEMPDIR)/ v1.10.3 GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/neilpa/yajsv@v1.4.0 GOBIN="$(shell realpath $(TEMPDIR))" go install github.com/sigstore/cosign/cmd/cosign@v1.5.1 diff --git a/test/cli/utils_test.go b/test/cli/utils_test.go index e985cc9833f..5751dea66b5 100644 --- a/test/cli/utils_test.go +++ b/test/cli/utils_test.go @@ -222,10 +222,16 @@ func getSyftBinaryLocation(t testing.TB) string { } func getSyftBinaryLocationByOS(t testing.TB, goOS string) string { + // note: for amd64 we need to update the snapshot location with the v1 suffix + // see : https://goreleaser.com/customization/build/#why-is-there-a-_v1-suffix-on-amd64-builds + archPath := runtime.GOARCH + if runtime.GOARCH == "amd64" { + archPath = fmt.Sprintf("%s_v1", archPath) + } // note: there is a subtle - vs _ difference between these versions switch goOS { case "darwin", "linux": - return path.Join(repoRoot(t), fmt.Sprintf("snapshot/%s-build_%s_%s/syft", goOS, goOS, runtime.GOARCH)) + return path.Join(repoRoot(t), fmt.Sprintf("snapshot/%s-build_%s_%s/syft", goOS, goOS, archPath)) default: t.Fatalf("unsupported OS: %s", runtime.GOOS) } diff --git a/test/compare/mac.sh b/test/compare/mac.sh index 7d52f4cb55a..3aadab2e2a0 100755 --- a/test/compare/mac.sh +++ b/test/compare/mac.sh @@ -39,7 +39,7 @@ else fi # run syft -SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64/syft" +SYFT_PATH="${DISTDIR}/darwin-build_darwin_amd64_v1/syft" chmod 755 "${SYFT_PATH}" "${SYFT_PATH}" version SYFT_CHECK_FOR_APP_UPDATE=0 "${SYFT_PATH}" packages docker-archive:${TEST_IMAGE_TAR} -vv -o json > "${REPORT}" diff --git a/test/compare/rpm.sh b/test/compare/rpm.sh index 53d6800c064..d84ff6df191 100755 --- a/test/compare/rpm.sh +++ b/test/compare/rpm.sh @@ -53,4 +53,4 @@ ${ACC_DIR}/compare.py \ ${GOLDEN_REPORT} \ ${REPORT} | tee ${RESULTSDIR}/acceptance-${TEST_TYPE}.txt -EXIT_CODE=0 \ No newline at end of file +EXIT_CODE=0 diff --git a/test/install/3_install_asset_test.sh b/test/install/3_install_asset_test.sh index bf3b86c5033..743c75129da 100755 --- a/test/install/3_install_asset_test.sh +++ b/test/install/3_install_asset_test.sh @@ -26,6 +26,12 @@ test_positive_snapshot_install_asset() { expected_path="${install_dir}/${binary}" assertFileExists "${expected_path}" "install_asset os=${os} arch=${arch} format=${format}" + # directory structure for arch has been updated as of go 1.18 + # https://goreleaser.com/customization/build/#why-is-there-a-_v1-suffix-on-amd64-buildsjk + if [ $arch == "amd64" ]; then + arch="amd64_v1" + fi + assertFilesEqual \ "$(snapshot_dir)/${os}-build_${os}_${arch}/${binary}" \ "${expected_path}" \