oncall-engine/helm/oncall/tests/migrate_annotations_test.yaml
Nelson 01c8eef0b3
Helm migrate job - support custom annotations (#2617)
# What this PR does
Adds support for custom annotations on the helm chart's migrate job

## Which issue(s) this PR fixes
https://github.com/grafana/oncall/issues/1618

## Checklist

- [X] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-25 11:51:49 -04:00

48 lines
1.4 KiB
YAML

suite: test migrate annotations
templates:
- engine/job-migrate.yaml
release:
name: oncall
tests:
- it: migrate.useHook=false -> should not provide an annotations block
set:
migrate.useHook: false
asserts:
- notExists:
path: metadata.annotations
- it: migrate.useHook=true -> should only provide the "helm.sh/hook" annotation
set:
migrate.useHook: true
asserts:
- isSubset:
path: metadata.annotations
content:
"helm.sh/hook": pre-install,pre-upgrade
- it: migrate.useHook=false and annotations set -> should only contain the custom annotations
set:
migrate.useHook: false
migrate.annotations:
some-annotation: some-value
other-annotation: other-value
asserts:
- isSubset:
path: metadata.annotations
content:
some-annotation: some-value
other-annotation: other-value
- it: migrate.useHook=true and annotations set -> should contain the custom annotations and the "helm.sh/hook" annotation
set:
migrate.useHook: true
migrate.annotations:
some-annotation: some-value
other-annotation: other-value
asserts:
- isSubset:
path: metadata.annotations
content:
"helm.sh/hook": pre-install,pre-upgrade
some-annotation: some-value
other-annotation: other-value