oncall-engine/helm/oncall/tests/telegram_polling_deployment_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

73 lines
2.1 KiB
YAML

suite: test telegram polling deployment
templates:
- telegram-polling/deployment.yaml
release:
name: oncall
tests:
- it: telegramPolling.enabled=false -> should not create deployment (default)
asserts:
- hasDocuments:
count: 0
- it: telegramPolling.enabled=true -> should create telegram polling deployment
set:
telegramPolling.enabled: true
asserts:
- containsDocument:
kind: Deployment
apiVersion: apps/v1
name: oncall-telegram-polling
- isSubset:
path: metadata.labels
content:
app.kubernetes.io/component: telegram-polling
app.kubernetes.io/instance: oncall
app.kubernetes.io/name: oncall
- isSubset:
path: spec.selector.matchLabels
content:
app.kubernetes.io/component: telegram-polling
app.kubernetes.io/instance: oncall
app.kubernetes.io/name: oncall
- isSubset:
path: spec.template.metadata.labels
content:
app.kubernetes.io/component: telegram-polling
app.kubernetes.io/instance: oncall
app.kubernetes.io/name: oncall
# Should contain only one replica to avoid Conflict while polling Telegram updates
- equal:
path: spec.replicas
value: 1
- equal:
path: spec.template.spec.serviceAccountName
value: oncall
- contains:
path: spec.template.spec.initContainers
content:
name: wait-for-db
any: true
- matchSnapshot:
path: spec.template.spec.containers
- it: telegramPolling.resources -> should specify resources
set:
telegramPolling:
enabled: true
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi