diff --git a/Makefile b/Makefile index 208124fb4..b600f93e1 100644 --- a/Makefile +++ b/Makefile @@ -242,13 +242,7 @@ ifneq ($(DEPLOYMENTNAMESPACE), default) endif kubectl apply -f $(MANIFESTPATH) $(ROOTDIR)/scripts/kube_create_storage.sh $(DEPLOYMENTNAMESPACE) - kubectl --namespace $(DEPLOYMENTNAMESPACE) \ - run arangodb-operator-test -i --rm --quiet --restart=Never \ - --image=$(shell docker inspect $(TESTIMAGE) '--format={{index .RepoDigests 0}}') \ - --env="ENTERPRISEIMAGE=$(ENTERPRISEIMAGE)" \ - --env="TEST_NAMESPACE=$(DEPLOYMENTNAMESPACE)" \ - -- \ - -test.v -test.timeout $(TESTTIMEOUT) $(TESTLENGTHOPTIONS) + $(ROOTDIR)/scripts/kube_run_tests.sh $(DEPLOYMENTNAMESPACE) $(TESTIMAGE) "$(ENTERPRISEIMAGE)" $(TESTTIMEOUT) $(TESTLENGTHOPTIONS) ifneq ($(DEPLOYMENTNAMESPACE), default) kubectl delete namespace $(DEPLOYMENTNAMESPACE) --ignore-not-found --now endif diff --git a/scripts/kube_run_tests.sh b/scripts/kube_run_tests.sh new file mode 100755 index 000000000..4cb942fa8 --- /dev/null +++ b/scripts/kube_run_tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Run kubectl run to run the integration tests. + +DEPLOYMENTNAMESPACE=$1 +TESTIMAGE=$2 +ENTERPRISEIMAGE=$3 +TESTTIMEOUT=$4 +TESTLENGTHOPTIONS=$5 + +IMAGEID=$(docker inspect ${TESTIMAGE} '--format={{index .RepoDigests 0}}') + +kubectl --namespace ${DEPLOYMENTNAMESPACE} \ + run arangodb-operator-test -i --rm --quiet --restart=Never \ + --image=${IMAGEID} \ + --env="ENTERPRISEIMAGE=${ENTERPRISEIMAGE}" \ + --env="TEST_NAMESPACE=${DEPLOYMENTNAMESPACE}" \ + -- \ + -test.v -test.timeout $TESTTIMEOUT $TESTLENGTHOPTIONS