From 06b9a79e3d96cc94da65663d7d7b700f1cedaa8a Mon Sep 17 00:00:00 2001 From: Laurent Goderre Date: Wed, 29 Nov 2023 13:39:28 -0500 Subject: [PATCH] chore: fix tests failing due to Mac Rosetta cache (#2374) Signed-off-by: Laurent Goderre --- syft/internal/fileresolver/container_image_all_layers_test.go | 3 +++ syft/internal/fileresolver/container_image_squash_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/syft/internal/fileresolver/container_image_all_layers_test.go b/syft/internal/fileresolver/container_image_all_layers_test.go index 6d94d7864..abe052a34 100644 --- a/syft/internal/fileresolver/container_image_all_layers_test.go +++ b/syft/internal/fileresolver/container_image_all_layers_test.go @@ -640,6 +640,9 @@ func TestAllLayersResolver_AllLocations(t *testing.T) { // this isn't important for the test, so we remove them. paths.Remove("/proc", "/sys", "/dev", "/etc") + // Remove cache created by Mac Rosetta when emulating different arches + paths.Remove("/.cache/rosetta", "/.cache") + pathsList := paths.List() sort.Strings(pathsList) diff --git a/syft/internal/fileresolver/container_image_squash_test.go b/syft/internal/fileresolver/container_image_squash_test.go index 19e32d9eb..dd186787a 100644 --- a/syft/internal/fileresolver/container_image_squash_test.go +++ b/syft/internal/fileresolver/container_image_squash_test.go @@ -547,6 +547,9 @@ func TestSquashResolver_AllLocations(t *testing.T) { // this isn't important for the test, so we remove them. paths.Remove("/proc", "/sys", "/dev", "/etc") + // Remove cache created by Mac Rosetta when emulating different arches + paths.Remove("/.cache/rosetta", "/.cache") + pathsList := paths.List() sort.Strings(pathsList)