Skip to content

Commit a4a03a5

Browse files
committed
adjust
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
1 parent 571de4d commit a4a03a5

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

.github/workflows/e2e.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
# Only one job at any time, and cancel in-progress
8+
concurrency:
9+
# Cancel when push to the same branch
10+
group: ${{ github.workflow }}-${{ github.head_ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
k8s:
15+
runs-on: compute-domain-runner
16+
steps:
17+
- uses: actions/checkout@v5
18+
- name: make-bats
19+
run: |
20+
export TEST_CHART_REPO="oci://ghcr.io/nvidia/k8s-dra-driver-gpu"
21+
export TEST_CHART_VERSION="25.8.0-dev-23ccbd2b-chart"
22+
make bats

tests/bats/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
7983
tests: 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

Comments
 (0)