oncall-engine/helm/oncall/tests/telegram_env_test.yaml
Alexander Cherepanov ec028eb9d9
Telegram long polling (#2250)
# What this PR does

Runs Telegram long polling to get updates. 
It's enabled by setting `FEATURE_TELEGRAM_LONG_POLLING_ENABLED=True`.
That will disable webhook and run separate deployment for telegram long
polling.

Telegram long polling is not very HA mode, but it does not need to
expose webhook url to internet and simplifies telegram integration.

## Which issue(s) this PR fixes

closes #561 

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-08-24 09:12:24 +02: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: https://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: "https://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"