mirror of
https://github.com/containers/skopeo.git
synced 2025-09-18 16:08:59 +00:00
Merge pull request #2703 from lsm5/integration-test-binary-path
test-integration-local: use SKOPEO_BINARY if set
This commit is contained in:
13
Makefile
13
Makefile
@@ -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:
|
||||
|
@@ -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")
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user