mirror of
https://github.com/truenas/charts.git
synced 2026-04-23 18:10:06 +08:00
99 lines
2.3 KiB
YAML
99 lines
2.3 KiB
YAML
suite: job spec test
|
|
templates:
|
|
- common.yaml
|
|
tests:
|
|
- it: should pass with workload enabled
|
|
set:
|
|
workload:
|
|
workload-name:
|
|
enabled: true
|
|
primary: true
|
|
type: Job
|
|
podSpec:
|
|
restartPolicy: Never
|
|
asserts:
|
|
- documentIndex: &jobDoc 0
|
|
isKind:
|
|
of: Job
|
|
- documentIndex: *jobDoc
|
|
isAPIVersion:
|
|
of: batch/v1
|
|
- documentIndex: *jobDoc
|
|
isSubset:
|
|
path: spec
|
|
content:
|
|
backoffLimit: 5
|
|
completionMode: NonIndexed
|
|
completions:
|
|
parallelism: 1
|
|
ttlSecondsAfterFinished: 120
|
|
|
|
- it: should apply spec correctly
|
|
set:
|
|
workload:
|
|
workload-name:
|
|
enabled: true
|
|
primary: true
|
|
type: Job
|
|
backoffLimit: 5
|
|
completionMode: Indexed
|
|
completions: 5
|
|
parallelism: 5
|
|
ttlSecondsAfterFinished: 100
|
|
activeDeadlineSeconds: 100
|
|
podSpec:
|
|
restartPolicy: Never
|
|
asserts:
|
|
- documentIndex: *jobDoc
|
|
isSubset:
|
|
path: spec
|
|
content:
|
|
backoffLimit: 5
|
|
completionMode: Indexed
|
|
completions: 5
|
|
parallelism: 5
|
|
ttlSecondsAfterFinished: 100
|
|
activeDeadlineSeconds: 100
|
|
|
|
- it: should set parallelism to 0 on ixChartContext - isStopped (true)
|
|
set:
|
|
global:
|
|
ixChartContext:
|
|
storageClassName: some-storage-class
|
|
isStopped: true
|
|
workload:
|
|
workload-name:
|
|
enabled: true
|
|
primary: true
|
|
type: Job
|
|
parallelism: 3
|
|
podSpec:
|
|
restartPolicy: Never
|
|
asserts:
|
|
- documentIndex: *jobDoc
|
|
isSubset:
|
|
path: spec
|
|
content:
|
|
parallelism: 0
|
|
|
|
- it: should not set parallelism to 0 on ixChartContext - isStopped (false)
|
|
set:
|
|
global:
|
|
ixChartContext:
|
|
storageClassName: some-storage-class
|
|
isStopped: false
|
|
workload:
|
|
workload-name:
|
|
enabled: true
|
|
primary: true
|
|
type: Job
|
|
parallelism: 3
|
|
podSpec:
|
|
restartPolicy: Never
|
|
asserts:
|
|
- documentIndex: *jobDoc
|
|
isSubset:
|
|
path: spec
|
|
content:
|
|
parallelism: 3
|