Skip to content

Commit fcf77b5

Browse files
[no-relnote] Update E2E test suite
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]> Signed-off-by: Evan Lezar <[email protected]> Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 398ba91 commit fcf77b5

File tree

18 files changed

+1182
-1452
lines changed

18 files changed

+1182
-1452
lines changed

.github/workflows/e2e.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,14 @@ jobs:
5858
- name: Run e2e tests
5959
env:
6060
KUBECONFIG: ${{ github.workspace }}/kubeconfig
61+
HELM_CHART: ${{ github.workspace }}/deployments/helm/nvidia-device-plugin
6162
E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin
6263
E2E_IMAGE_TAG: ${{ inputs.version }}
64+
E2E_IMAGE_PULL_POLICY: Always
65+
NVIDIA_DRIVER_ENABLED: true
6366
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs
6467
run: |
65-
make test-e2e
68+
make -f tests/e2e/Makefile test
6669
6770
- name: Archive test logs
6871
if: ${{ failure() }}
@@ -72,6 +75,13 @@ jobs:
7275
path: ./e2e_logs/
7376
retention-days: 15
7477

78+
- name: Archive Ginkgo logs
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: ginkgo-logs
82+
path: ginkgo.json
83+
retention-days: 15
84+
7585
- name: Send Slack alert notification
7686
id: slack
7787
if: false
@@ -80,8 +90,10 @@ jobs:
8090
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
8191
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
8292
with:
83-
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
84-
slack-message: |
85-
:x: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed.
93+
method: chat.postMessage
94+
token: ${{ secrets.SLACK_BOT_TOKEN }}
95+
payload: |
96+
channel: ${{ secrets.SLACK_CHANNEL_ID }}
97+
text: ":x: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed.
8698
87-
Details: ${{ env.SUMMARY_URL }}
99+
Details: ${{ env.SUMMARY_URL }}"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
deployments/helm/gpu-feature-discovery
77
cmd/gpu-feature-discovery/gfd-test-loop
88
e2e_logs
9-
9+
bin
1010
*.out
1111
*.log
12+
ginkgo.json

testdata/job-1.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: j-e2e-1
5+
labels:
6+
app.nvidia.com: k8s-device-plugin-test-app
7+
spec:
8+
template:
9+
metadata:
10+
name: gpu-pod
11+
spec:
12+
restartPolicy: Never
13+
containers:
14+
- name: cuda-container
15+
image: nvcr.io/nvidia/k8s/cuda-sample:nbody-cuda11.7.1-ubuntu18.04
16+
args:
17+
- "--benchmark"
18+
- "--numbodies=10000"
19+
resources:
20+
limits:
21+
nvidia.com/gpu: "1"
22+
tolerations:
23+
- key: "nvidia.com/gpu"
24+
operator: "Exists"
25+
effect: "NoSchedule"

tests/e2e/Makefile

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -20,29 +20,33 @@ GO_TEST_TIMEOUT ?= 30m
2020

2121
include $(CURDIR)/versions.mk
2222

23-
DRIVER_ENABLED ?= true
23+
NVIDIA_DRIVER_ENABLED ?= true
2424

2525
E2E_IMAGE_REPO ?= $(REGISTRY)/$(DRIVER_NAME)
2626
E2E_IMAGE_TAG ?= $(VERSION)
2727
E2E_IMAGE_PULL_POLICY ?= IfNotPresent
2828
HELM_CHART ?= $(CURDIR)/deployments/helm/nvidia-device-plugin
2929
LOG_ARTIFACTS ?= $(CURDIR)/e2e_logs
3030

31-
.PHONY: test
32-
test:
33-
@if [ -z ${KUBECONFIG} ]; then \
34-
echo "[ERR] KUBECONFIG missing, must be defined"; \
35-
exit 1; \
36-
fi
37-
cd $(CURDIR)/tests/e2e && $(GO_CMD) test -timeout $(GO_TEST_TIMEOUT) -v . -args \
38-
-kubeconfig=$(KUBECONFIG) \
39-
-driver-enabled=$(DRIVER_ENABLED) \
40-
-image.repo=$(E2E_IMAGE_REPO) \
41-
-image.tag=$(E2E_IMAGE_TAG) \
42-
-image.pull-policy=$(E2E_IMAGE_PULL_POLICY) \
43-
-log-artifacts=$(LOG_ARTIFACTS) \
44-
-helm-chart=$(HELM_CHART) \
45-
-helm-log-file=$(LOG_ARTIFACTS)/helm.log \
46-
-ginkgo.focus="\[nvidia\]" \
47-
-test.timeout=1h \
48-
-ginkgo.v
31+
# Test configuration
32+
GINKGO_COMMON_ARGS := -v --fail-on-pending --randomize-all --trace
33+
GINKGO_REPORT_ARGS := --json-report=$(LOG_ARTIFACTS)/report.json --junit-report=$(LOG_ARTIFACTS)/junit.xml
34+
35+
.PHONY: ginkgo test clean-artifacts
36+
37+
GINKGO_VERSION = $(shell grep -Eo "github.com/onsi/ginkgo/v2.*$$" ./tests/go.mod | sed -e 's&github.com/onsi/ginkgo/v2[[:space:]]&&g')
38+
ginkgo:
39+
mkdir -p $(CURDIR)/bin
40+
GOBIN=$(CURDIR)/bin go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION)
41+
42+
# Create artifacts directory
43+
$(LOG_ARTIFACTS):
44+
mkdir -p $(LOG_ARTIFACTS)
45+
46+
# Clean artifacts
47+
clean-artifacts:
48+
rm -rf $(LOG_ARTIFACTS)
49+
50+
# Run tests
51+
test: ginkgo $(LOG_ARTIFACTS)
52+
$(CURDIR)/bin/ginkgo $(GINKGO_COMMON_ARGS) $(GINKGO_REPORT_ARGS) $(GINKGO_ARGS) ./tests/e2e/...

tests/e2e/common/gpu_job.go

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

0 commit comments

Comments
 (0)