--- # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json suite: cronjob - fields - restartPolicy templates: - common.yaml values: - ../_values/controllers_main_default_container.yaml set: controllers.main.type: cronjob controllers.main.cronjob.schedule: "*/20 * * * *" tests: - it: default configuration should pass documentSelector: path: $[?(@.kind == "CronJob")].metadata.name value: release-name asserts: - equal: path: spec.jobTemplate.spec.template.spec.restartPolicy value: Never - it: custom configuration should pass set: controllers.main.pod.restartPolicy: OnFailure documentSelector: path: $[?(@.kind == "CronJob")].metadata.name value: release-name asserts: - equal: path: spec.jobTemplate.spec.template.spec.restartPolicy value: OnFailure