From f5a028e4d9dd2bec64d3adff150604f3bb1b7074 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 9 Mar 2021 09:34:02 -0500 Subject: [PATCH] Fix skipping tests in test container Without this env. var. being set from hack/make.sh, many/most integration tests will `SKIP`. Fix this by notifying the user and setting the magic `SKOPEO_CONTAINER_TESTS` variable. Signed-off-by: Chris Evich --- Makefile | 4 ++++ hack/make.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 1be8bf0f..61994b4b 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,10 @@ ifeq ($(GOBIN),) GOBIN := $(GOPATH)/bin endif +# Required for integration-tests to detect they are running inside a specific +# container image. Env. var defined in image, make does not automatically +# pass to children unless explicitly exported +export container_magic CONTAINER_RUNTIME := $(shell command -v podman 2> /dev/null || echo docker) GOMD2MAN ?= $(shell command -v go-md2man || echo '$(GOBIN)/go-md2man') diff --git a/hack/make.sh b/hack/make.sh index c26c9855..6850f36f 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -35,6 +35,9 @@ if [[ "$container_magic" != "85531765-346b-4316-bdb8-358e4cca9e5d" ]]; then echo "# Try this instead: make all" echo "#" } >&2 +else + echo "# I appear to be running inside my designated container image, good!" + export SKOPEO_CONTAINER_TESTS=1 fi echo