diff --git a/acceptance/builder_test.go b/acceptance/builder_test.go index 38a4b2524..1dec4a669 100644 --- a/acceptance/builder_test.go +++ b/acceptance/builder_test.go @@ -27,7 +27,6 @@ var ( func TestBuilder(t *testing.T) { h.SkipIf(t, runtime.GOOS == "windows", "Builder acceptance tests are not yet supported on Windows") - h.SkipIf(t, runtime.GOARCH != "amd64", "Builder acceptance tests are not yet supported on non-amd64") info, err := h.DockerCli(t).Info(context.TODO()) h.AssertNil(t, err) @@ -39,6 +38,8 @@ func TestBuilder(t *testing.T) { builderDaemonArch = info.Architecture if builderDaemonArch == "x86_64" { builderDaemonArch = "amd64" + } else if builderDaemonArch == "aarch64" { + builderDaemonArch = "arm64" } h.MakeAndCopyLifecycle(t, builderDaemonOS, builderDaemonArch, builderBinaryDir) diff --git a/acceptance/detector_test.go b/acceptance/detector_test.go index 8ab7609cc..285e4885a 100644 --- a/acceptance/detector_test.go +++ b/acceptance/detector_test.go @@ -4,6 +4,7 @@ package acceptance import ( + "context" "fmt" "os" "os/exec" @@ -22,17 +23,32 @@ import ( ) var ( - detectDockerContext = filepath.Join("testdata", "detector") - detectorBinaryDir = filepath.Join("testdata", "detector", "container", "cnb", "lifecycle") - detectImage = "lifecycle/acceptance/detector" - userID = "1234" + detectDockerContext = filepath.Join("testdata", "detector") + detectorBinaryDir = filepath.Join("testdata", "detector", "container", "cnb", "lifecycle") + detectImage = "lifecycle/acceptance/detector" + userID = "1234" + detectorDaemonOS, detectorDaemonArch string ) func TestDetector(t *testing.T) { h.SkipIf(t, runtime.GOOS == "windows", "Detector acceptance tests are not yet supported on Windows") - h.SkipIf(t, runtime.GOARCH != "amd64", "Detector acceptance tests are not yet supported on non-amd64") - h.MakeAndCopyLifecycle(t, "linux", "amd64", detectorBinaryDir) + info, err := h.DockerCli(t).Info(context.TODO()) + h.AssertNil(t, err) + + // These variables are clones of the variables in analyzer_test.go. + // You can find the same variables there without `builder` prefix. + // These lines are added for supporting windows tests. + detectorDaemonOS = info.OSType + detectorDaemonArch = info.Architecture + if detectorDaemonArch == "x86_64" { + detectorDaemonArch = "amd64" + } + if detectorDaemonArch == "aarch64" { + detectorDaemonArch = "arm64" + } + + h.MakeAndCopyLifecycle(t, detectorDaemonOS, detectorDaemonArch, detectorBinaryDir) h.DockerBuild(t, detectImage, detectDockerContext,