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

108 lines
3.1 KiB
YAML

suite: test MySQL password envs for deployments
release:
name: oncall
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
- telegram-polling/deployment.yaml
- secrets.yaml
tests:
- it: secrets -> should fail if externalMysql.password not set
set:
mariadb.enabled: false
asserts:
- failedTemplate:
errorMessage: externalMysql.password is required if not mariadb.enabled and not externalMysql.existingSecret
template: secrets.yaml
- it: externalMySQL.password -> should create a Secret -mariadb-external
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
- telegram-polling/deployment.yaml
set:
telegramPolling.enabled: true
mariadb.enabled: false
externalMysql:
user: user123
password: abcd123
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_USER
value: user123
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: oncall-mysql-external
key: mariadb-root-password
- containsDocument:
kind: Secret
apiVersion: v1
name: oncall-mysql-external
template: secrets.yaml
- equal:
path: data.mariadb-root-password
value: abcd123
decodeBase64: true
documentIndex: 1
template: secrets.yaml
- it: externalMysql.existingSecret -> should use existing secret
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
set:
mariadb.enabled: false
externalMysql:
existingSecret: some-mysql-secret
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_USER
value: root
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: some-mysql-secret
key: mariadb-root-password
- it: externalMysql.usernameKey and externalMysql.passwordKey -> should be used for existing secret
templates:
- engine/deployment.yaml
- engine/job-migrate.yaml
- celery/deployment.yaml
set:
mariadb.enabled: false
externalMysql:
existingSecret: some-mysql-secret
usernameKey: mysql.user
passwordKey: mysql.key
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_USER
valueFrom:
secretKeyRef:
name: some-mysql-secret
key: mysql.user
- contains:
path: spec.template.spec.containers[0].env
content:
name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: some-mysql-secret
key: mysql.key