Skip to content

Commit 31a854f

Browse files
authored
Merge pull request #162 from NearNodeFlash:fix/kind-integration-test-tuneup
Add kind cluster support: auto-detect kind and skip incompatible tests
2 parents 3e52df1 + 6911c26 commit 31a854f

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

Makefile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ endif
99
export PATH := $(HOME)/go/bin:$(PATH)
1010

1111
# Base command to start the tests with ginkgo
12-
GINKGO_RUN?=CGO_ENABLED=0 ginkgo run ${PARALLEL_OPT} --v
12+
GINKGO_RUN?=CGO_ENABLED=0 ginkgo run ${PARALLEL_OPT} --v --fail-fast
1313

1414
all: fmt vet
1515

@@ -22,9 +22,19 @@ vet:
2222
go vet ./...
2323

2424
# TODO: would be nice to tie this to a script that also deletes all the workflows and makes sure nothing is left over
25+
# Clean up resources that may be left behind by interrupted test runs
2526
.PHONY: clean
2627
clean:
28+
@echo "Removing triage namespace..."
2729
kubectl delete namespace nnf-system-needs-triage --ignore-not-found
30+
@echo "Removing leftover UID verification pods..."
31+
kubectl delete pods -n default --ignore-not-found $$(kubectl get pods -n default --no-headers -o custom-columns=':metadata.name' 2>/dev/null | grep '^verify-uid-') 2>/dev/null; true
32+
@echo "Checking for persistent storage instances..."
33+
@psi=$$(kubectl get persistentstorageinstances -A --no-headers 2>/dev/null); \
34+
if [ -n "$$psi" ]; then \
35+
echo "WARNING: Persistent storage instances still exist. These require a destroy_persistent workflow to remove:" >&2; \
36+
echo "$$psi" >&2; \
37+
fi
2838

2939
.PHONY: init
3040
init:
@@ -33,12 +43,22 @@ init:
3343
# Run all the tests
3444
.PHONY: test
3545
test:
36-
${GINKGO_RUN} .
46+
@if kubectl config current-context 2>/dev/null | grep -q 'kind-'; then \
47+
echo "Detected kind cluster. Switching to 'make kind' (excludes global-lustre tests)." >&2; \
48+
$(MAKE) kind; \
49+
else \
50+
${GINKGO_RUN} . ; \
51+
fi
3752

3853
# Alias for all the tests
3954
.PHONY: full
4055
full: test
4156

57+
# Run tests compatible with a kind environment (excludes tests requiring real Lustre mounts)
58+
.PHONY: kind
59+
kind:
60+
${GINKGO_RUN} --label-filter='!global-lustre && !multi-storage && !lustre-csimount && !high-capacity' .
61+
4262
# Run one test to ensure system is in working order
4363
.PHONY: sanity
4464
sanity:

int_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ var tests = []*T{
102102
// WithStorageProfile().DelayInState(dwsv1alpha7.StateDataIn, 15*time.Second).StopAfter(dwsv1alpha7.StatePreRun).Focused(),
103103
MakeTest("XFS with Storage Profile and LV Create",
104104
"#DW jobdw type=xfs name=xfs-storage-profile capacity=14TB profile=my-xfs-storage-profile").
105-
WithStorageProfileLvCreate("--zero n --activate y --type raid5 --nosync --extents $PERCENT_VG --stripes $DEVICE_NUM-1 --stripesize=64KiB --name $LV_NAME $VG_NAME"),
105+
WithStorageProfileLvCreate("--zero n --activate y --type raid5 --nosync --extents $PERCENT_VG --stripes $DEVICE_NUM-1 --stripesize=64KiB --name $LV_NAME $VG_NAME").
106+
WithLabels("high-capacity"),
106107

107108
// Persistent
108109
MakeTest("Persistent Lustre",
@@ -150,7 +151,7 @@ var tests = []*T{
150151
"#DW jobdw type=lustre name=lustre-with-containers-mpi capacity=100GB",
151152
"#DW container name=lustre-with-containers-mpi profile=example-mpi "+
152153
"DW_JOB_foo_local_storage=lustre-with-containers-mpi").
153-
WithPermissions(userID, groupID).WithLabels("mpi"),
154+
WithPermissions(userID, groupID).WithLabels("mpi", "lustre-csimount"),
154155
MakeTest("GFS2 and Global Lustre with MPI Containers",
155156
"#DW jobdw type=gfs2 name=gfs2-and-global-with-containers-mpi capacity=100GB",
156157
"#DW container name=gfs2-and-global-with-containers-mpi profile=example-mpi "+
@@ -217,15 +218,15 @@ var tests = []*T{
217218
WithContainerProfile("example-fail", &ContainerProfileOptions{RetryLimit: pointy.Int(0)}).
218219
ExpectError(dwsv1alpha7.StatePostRun),
219220

220-
// Containers - Unsupported Filesystems. These should fail as xfs/raw filesystems are not supported for containers.
221+
// Containers - Unsupported Filesystems. XFS is not supported for containers.
221222
MakeTest("XFS with Containers",
222223
"#DW jobdw type=xfs name=xfs-with-containers capacity=100GB",
223224
"#DW container name=xfs-with-containers profile=example-success DW_JOB_foo_local_storage=xfs-with-containers").
224225
ExpectError(dwsv1alpha7.StateProposal).WithLabels("unsupported-fs"),
225226
MakeTest("Raw with Containers",
226227
"#DW jobdw type=raw name=raw-with-containers capacity=100GB",
227228
"#DW container name=raw-with-containers profile=example-success DW_JOB_foo_local_storage=raw-with-containers").
228-
ExpectError(dwsv1alpha7.StateProposal).WithLabels("unsupported-fs"),
229+
WithPermissions(userID, groupID).WithLabels("non-mpi"),
229230

230231
// Containers - Multiple Storages
231232
MakeTest("GFS2 and Lustre with Containers",

0 commit comments

Comments
 (0)