Skip to content

Commit

Permalink
Potentially use docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
psav committed Nov 10, 2022
1 parent 471f637 commit 0c411de
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG BASE_IMAGE=
FROM $BASE_IMAGE

WORKDIR /workspace

COPY . .
2 changes: 1 addition & 1 deletion build/pr_check_inner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ $KUBECTL_CMD get env

source build/run_kuttl.sh --report xml
KUTTL_RESULT=$?
mv kuttl-test.xml artifacts/junit-kuttl.xml
mv kuttl-report.xml artifacts/junit-kuttl.xml

CLOWDER_PODS=$($KUBECTL_CMD get pod -n clowder-system -o jsonpath='{.items[*].metadata.name}')
for pod in $CLOWDER_PODS; do
Expand Down
25 changes: 22 additions & 3 deletions pr_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,31 @@ fi
export IMAGE_TAG=`git rev-parse --short=8 HEAD`
export IMAGE_NAME=quay.io/cloudservices/clowder

export GOROOT="/opt/go/1.18.4"
export PATH="${GOROOT}/bin:${PATH}"
echo $BASE_IMG

make envtest
make update-version
make test

TEST_CONT="clowder-unit-"$IMAGE_TAG
docker build -t $TEST_CONT -f Dockerfile.test --build-arg BASE_IMAGE=$BASE_IMG .

docker run -i \
-v `$PWD/bin/setup-envtest use -p path`:/bins:ro \
-e IMAGE_NAME=$IMAGE_NAME \
-e IMAGE_TAG=$IMAGE_TAG \
-e QUAY_USER=$QUAY_USER \
-e QUAY_TOKEN=$QUAY_TOKEN \
-e MINIKUBE_HOST=$MINIKUBE_HOST \
-e MINIKUBE_ROOTDIR=$MINIKUBE_ROOTDIR \
-e MINIKUBE_USER=$MINIKUBE_USER \
-e CLOWDER_VERSION=$CLOWDER_VERSION \
$TEST_CONT \
make test
UNIT_TEST_RESULT=$?

if [[ $UNIT_TEST_RESULT -ne 0 ]]; then
exit $UNIT_TEST_RESULT
fi

CLOWDER_VERSION=`git describe --tags`

Expand Down

0 comments on commit 0c411de

Please sign in to comment.