@@ -75,8 +75,13 @@ image:
7575# suite/file 'setup' in bats, but we'd lose output on success). During dev, you
7676# may want to add --show-output-of-passing-tests (and read bats docs for other
7777# cmdline args).
78+ #
79+ # In CI, this target is executed containerized (and uses docker-in-docker).
80+ # $(KUBECONFIG) (a mount source) must be a path on the host.
81+ #
7882.PHONY : tests
7983tests : image
84+ echo " KUBECONFIG: $( KUBECONFIG) " && \
8085 export _RUNDIR_PARENT=/tmp/k8s-dra-driver-gpu-tests-out && \
8186 mkdir -p " $$ {_RUNDIR_PARENT}" && \
8287 export _RUNDIR=$$(mktemp -p $${_RUNDIR_PARENT} -d -t bats-tests-$$(date +%s ) -XXXXX ) && \
@@ -85,8 +90,8 @@ tests: image
8590 $(DOCKER_RUN_FLAGS ) \
8691 -v /tmp:/tmp \
8792 -v $(CURDIR ) :/cwd \
88- -v $(HOME ) /.kube/: $( HOME ) /.kube \
89- --env KUBECONFIG=$( KUBECONFIG ) \
93+ -v $(KUBECONFIG ) :/kubeconfig \
94+ --env KUBECONFIG=/kubeconfig \
9095 --env TEST_CHART_REPO=$(TEST_CHART_REPO ) \
9196 --env TEST_CHART_VERSION=$(TEST_CHART_VERSION ) \
9297 --env TEST_CHART_LASTSTABLE_REPO=$(TEST_CHART_LASTSTABLE_REPO ) \
@@ -97,7 +102,7 @@ tests: image
97102 -u $(shell id -u ${USER}) :$(shell id -g ${USER}) \
98103 --entrypoint " /bin/bash" \
99104 $(BATS_IMAGE ) \
100- -c " set -ex; cd /cwd; \
105+ -c " set -ex; cd /cwd; cat /kubeconfig | head -n2; kubectl get nodes; \
101106 echo ' Running k8s cluster cleanup (invasive)... ' ; \
102107 bash tests/bats/cleanup-from-previous-run.sh 2>&1 | tee -a $$ {_RUNDIR}/cleanup.outerr; \
103108 TMPDIR=$$ {_RUNDIR} bats \
0 commit comments