Skip to content

Commit 213e99e

Browse files
committed
add hook to run chainsaw test
Signed-off-by: Rahul Sharma <[email protected]>
1 parent df632a6 commit 213e99e

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ jobs:
330330
CONTAINER_RUNTIME: "containerd"
331331
TEST_CASE: "./tests/cases/defaults.sh"
332332
run: |
333+
apt update && apt install -y curl
334+
curl -fsSL https://get.jetify.com/devbox | FORCE=1 bash
335+
echo | devbox run chainsaw-tests
333336
echo "${{ secrets.AWS_SSH_KEY }}" > ${private_key} && chmod 400 ${private_key}
334337
./tests/ci-run-e2e.sh ${OPERATOR_IMAGE} ${OPERATOR_VERSION} ${GPU_PRODUCT_NAME} ${TEST_CASE} || rc=$?
335338
./tests/scripts/pull.sh /tmp/logs logs

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,6 @@ install-tools:
299299
@echo Installing tools from tools.go
300300
export GOBIN=$(PROJECT_DIR)/bin && \
301301
grep '^\s*_' tools/tools.go | awk '{print $$2}' | xargs -tI % $(GO_CMD) install -mod=readonly -modfile=tools/go.mod %
302+
303+
e2etest:
304+
KUBECONFIG=$(PROJECT_DIR)/kubeconfig chainsaw test $(PROJECT_DIR)/e2etests/tests/

devbox.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"shell": {
2020
"init_hook": [
2121
"export \"GOROOT=$(go env GOROOT)\""
22-
]
22+
],
23+
"scripts": {
24+
"chainsaw-tests": "make e2etest"
25+
}
2326
}
2427
}

e2etests/tests/default-helm-install/chainsaw-test.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ spec:
1616
# removed by "helm uninstall" and may interfere with other tests. By using
1717
# "helm template" we ensure chainsaw is able to clean up all resources it
1818
# creates during the test.
19-
- name: install gpu operator
19+
- name: generate gpu operator manifests
2020
try:
2121
- script:
2222
content: |
2323
set -e
2424
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
2525
helm repo update
26-
helm template gpu-operator nvidia/gpu-operator --namespace $NAMESPACE > /tmp/default-gpu-operator.yaml
27-
- apply:
28-
file: /tmp/default-gpu-operator.yaml
26+
helm install --wait gpu-operator -n $NAMESPACE --create-namespace nvidia/gpu-operator
2927
3028
# Sample step to list pods in the namespace
3129
- name: list gpu operator pods
@@ -73,3 +71,10 @@ spec:
7371
kubectl get pod pod-with-gpu -n $NAMESPACE -o wide
7472
kubectl describe pod pod-with-gpu -n $NAMESPACE
7573
kubectl logs pod-with-gpu -n $NAMESPACE
74+
75+
- name: cleanup gpu operator
76+
finally:
77+
- script:
78+
content: |
79+
set -e
80+
helm uninstall gpu-operator -n $NAMESPACE || true

0 commit comments

Comments
 (0)