Merge pull request #2703 from lsm5/integration-test-binary-path

test-integration-local: use SKOPEO_BINARY if set
This commit is contained in:
Miloslav Trmač
2025-09-17 15:06:55 +02:00
committed by GitHub
4 changed files with 18 additions and 8 deletions

View File

@@ -201,11 +201,15 @@ test-integration:
$(MAKE) test-integration-local
# Helper target to set up SKOPEO_BINARY variable for local test targets
.eval-skopeo-binary: $(if $(SKOPEO_BINARY),,bin/skopeo)
$(eval SKOPEO_BINARY := $(or $(SKOPEO_BINARY),./bin/skopeo))
@echo "Testing with $(SKOPEO_BINARY) ..."
# Primarily intended for CI.
test-integration-local: bin/skopeo
test-integration-local: .eval-skopeo-binary
hack/warn-destructive-tests.sh
$(MAKE) PREFIX=/usr install
cd ./integration && $(GO) test $(SKOPEO_LDFLAGS) $(TESTFLAGS) $(if $(BUILDTAGS),-tags "$(BUILDTAGS)")
cd ./integration && SKOPEO_BINARY="$(abspath $(SKOPEO_BINARY))" $(GO) test $(SKOPEO_LDFLAGS) $(TESTFLAGS) $(if $(BUILDTAGS),-tags "$(BUILDTAGS)")
# complicated set of options needed to run podman-in-podman
test-system:
@@ -220,9 +224,8 @@ test-system:
exit $$rc
# Primarily intended for CI.
test-system-local: $(if $(SKOPEO_BINARY),,bin/skopeo)
test-system-local: .eval-skopeo-binary
hack/warn-destructive-tests.sh
@echo "Testing with $(or $(SKOPEO_BINARY),$(eval SKOPEO_BINARY := "bin/skopeo")$(SKOPEO_BINARY)) ..."
bats --tap systemtest
test-unit:

View File

@@ -50,7 +50,7 @@ func (s *skopeoSuite) TearDownSuite() {
func (s *skopeoSuite) TestVersion() {
t := s.T()
assertSkopeoSucceeds(t, fmt.Sprintf(".*%s version %s.*", skopeoBinary, version.Version),
assertSkopeoSucceeds(t, fmt.Sprintf(".*skopeo version %s.*", version.Version),
"--version")
}

View File

@@ -282,7 +282,7 @@ func newProxy() (*proxy, error) {
}
// Note ExtraFiles starts at 3
proc := exec.Command("skopeo", "experimental-image-proxy", "--sockfd", "3")
proc := exec.Command(skopeoBinary, "experimental-image-proxy", "--sockfd", "3")
proc.Stderr = os.Stderr
cmdLifecycleToParentIfPossible(proc)
proc.ExtraFiles = append(proc.ExtraFiles, theirfd)

View File

@@ -20,7 +20,14 @@ import (
"go.podman.io/image/v5/manifest"
)
const skopeoBinary = "skopeo"
// FIXME: Move to SetupSuite
// https://github.com/containers/skopeo/pull/2703#discussion_r2331374730
var skopeoBinary = func() string {
if binary := os.Getenv("SKOPEO_BINARY"); binary != "" {
return binary
}
return "skopeo"
}()
const testFQIN = "docker://quay.io/libpod/busybox" // tag left off on purpose, some tests need to add a special one
const testFQIN64 = "docker://quay.io/libpod/busybox:amd64"