oncall-engine/helm/oncall/tests/telegram_env_test.yaml
Michael Derynck 0efe51d310
Update helm chart for newer grafana + enable externalServiceAccounts (#4876)
# What this PR does
Updates the helm chart and docker compose files with the required
changes to support the plugin initialization changes. Updated
instructions on the README.md show how to setup & intialize OnCall
without needing to go to the configuration page, this is currently the
preferred method.

## Which issue(s) this PR closes

Related to [issue link here]

<!--
*Note*: If you want the issue to be auto-closed once the PR is merged,
change "Related to" to "Closes" in the line above.
If you have more than one GitHub issue that this PR closes, be sure to
preface
each issue link with a [closing
keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue).
This ensures that the issue(s) are auto-closed once the PR has been
merged.
-->

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] Added the relevant release notes label (see labels prefixed w/
`release:`). These labels dictate how your PR will
    show up in the autogenerated release notes.

---------

Co-authored-by: GitHub Actions <actions@github.com>
2024-09-05 12:18:07 -06:00

79 lines
2.3 KiB
YAML

suite: test telegram envs for deployments
templates:
- engine/deployment.yaml
- celery/deployment.yaml
- telegram-polling/deployment.yaml
release:
name: oncall
tests:
- it: oncall.telegram.enabled=false -> Telegram integration disabled (default)
templates:
- engine/deployment.yaml
- celery/deployment.yaml
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: FEATURE_TELEGRAM_INTEGRATION_ENABLED
value: "False"
- it: oncall.telegram.enabled=true -> should enable Telegram integration
templates:
- engine/deployment.yaml
- celery/deployment.yaml
set:
oncall.telegram:
enabled: true
webhookUrl: http://example.com
token: "abcd:123"
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: FEATURE_TELEGRAM_INTEGRATION_ENABLED
value: "True"
- contains:
path: spec.template.spec.containers[0].env
content:
name: TELEGRAM_WEBHOOK_HOST
value: "http://example.com"
- contains:
path: spec.template.spec.containers[0].env
content:
name: TELEGRAM_TOKEN
value: "abcd:123"
- it: oncall.telegram.existingSecret=some-secret -> should prefer existing secret over oncall.telegram.token
templates:
- engine/deployment.yaml
- celery/deployment.yaml
set:
oncall.telegram:
enabled: true
token: "abcd:123"
existingSecret: some-secret
tokenKey: token
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: TELEGRAM_TOKEN
valueFrom:
secretKeyRef:
name: some-secret
key: token
- it: telegramPolling.enabled=true -> should enable oncall.telegram.enabled too
set:
telegramPolling.enabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: FEATURE_TELEGRAM_INTEGRATION_ENABLED
value: "True"
- contains:
path: spec.template.spec.containers[0].env
content:
name: FEATURE_TELEGRAM_LONG_POLLING_ENABLED
value: "True"