Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 54 additions & 6 deletions helm/slurm/tests/nodeset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tests:
tag: v1.2.3
asserts:
- matchSnapshot: {}

- it: should set imagePullSecrets
set:
imagePullSecrets:
Expand All @@ -32,7 +33,32 @@ tests:
- equal:
path: spec.template.spec.imagePullSecrets[1].name
value: docker-secret-2
- it: should set resourceSettings

- it: should set pod template resource claims
set:
nodesets:
slinky:
enabled: true
podSpec:
resourceClaims:
- name: gpu
resourceClaimName: slurm-nodeset-gpu
resources:
claims:
- name: gpu
asserts:
- contains:
path: spec.template.spec.resourceClaims
content:
name: gpu
resourceClaimName: slurm-nodeset-gpu
- equal:
path: spec.template.spec.resources
value:
claims:
- name: gpu

- it: should set pod template resources
set:
nodesets:
slinky:
Expand All @@ -55,6 +81,7 @@ tests:
requests:
cpu: "1"
memory: "2"

- it: should add nodeSelector
set:
nodesets:
Expand All @@ -67,6 +94,7 @@ tests:
- equal:
path: spec.template.spec.nodeSelector["beta.kubernetes.io/os"]
value: linux

- it: should set affinity
set:
nodesets:
Expand All @@ -84,8 +112,17 @@ tests:
- x86_64
asserts:
- equal:
path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0]
value: x86_64
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: arch
operator: In
values:
- x86_64

- it: should add tolerations
set:
nodesets:
Expand All @@ -101,6 +138,7 @@ tests:
- equal:
path: spec.template.spec.tolerations[0].key
value: test

- it: should add topologySpreadConstraints
set:
nodesets:
Expand All @@ -115,9 +153,16 @@ tests:
matchLabels:
foo: bar
asserts:
- equal:
path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels.foo
value: bar
- contains:
path: spec.template.spec.topologySpreadConstraints
content:
maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
foo: bar

- it: should set pinToNode
set:
nodesets:
Expand All @@ -128,6 +173,7 @@ tests:
- equal:
path: spec.pinToNode
value: true

- it: should not use priority class
set:
priorityClass:
Expand All @@ -140,6 +186,7 @@ tests:
- equal:
path: spec.template.spec.priorityClassName
value: ""

- it: should use priority class
set:
priorityClass:
Expand All @@ -152,6 +199,7 @@ tests:
- equal:
path: spec.template.spec.priorityClassName
value: slurm-priorityclass

- it: should override priority class
set:
priorityClass:
Expand Down