2023-06-12 09:34:36 +06:00
|
|
|
suite: test PostgreSQL envs for deployments
|
2023-05-26 19:50:24 +06:00
|
|
|
templates:
|
|
|
|
|
- engine/deployment.yaml
|
|
|
|
|
- engine/job-migrate.yaml
|
fix a few flaky e2e tests + allow running project locally via k8s/helm (#2751)
# What this PR does
- updates the GitHub Actions workflow to move the e2e tests into a
"[reusable
workflow](https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow)"
which are run in two scenarios:
- all tests _except_ those annotated as `@expensive` are run against
`grafana/grafana:latest` on all feature branches
- all tests _including_ `@expensive` tests are run on weekdays @ 07h00
UTC, against a matrix of 6 grafana versions. Results of these builds
will be posted to `#irm-amixr-flux` Slack channel.
- local development will now be:
```bash
make build-dev-images init-k8s start-k8s
```
- `build-dev-images` - builds the engine and UI docker images (only need
to run first time)
- `init-k8s` - creates a `kind` cluster and loads the two Docker images
onto the cluster nodes (only need to run first time)
- `start-k8s` - switches `kubectl` context to the created `kind`
cluster, and uses `helm` to deploy everything as defined in
`./dev/helm-local.yml` and `./dev/helm-local.dev.yml` (that latter file
is `.gitignored` and specific to how _you_ want your setup to look like.
Hot reloading works as before. This is the _start_ of #2381. (I've
marked these `make` commands as beta, because they've not yet been
thoroughly tested for local development).
- modifies the `helm` chart to add the concept of `oncall.devMode`,
`ui`, and ability to run oncall w/ sqlite
- `oncall.devMode` will essentially just add `volumes` and
`volumeMounts` to the various engine/migrate containers +
- `ui.enabled` + `ui.env` - create a ui container (which is needed for
hot reloading locally)
- `sqlite` - this was useful for the e2e test environments where Github
runner resources are scarce. Running `mariadb` eats up precious
resources, instead lets just use sqlite here
- fixes an issue that caused sporadic HTTP 502s from the grafana
plugin-proxy, which led to flaky tests. See [this
comment](https://github.com/grafana/oncall/pull/2751/files#diff-09040e8df192699b9c5742110ebbe8d9d5c3938cb156cc1cb99fa1c3fdee4fefR72-R77)
for more context + a link to a relevant Slack conversation. **tldr;**
there is a bug with the Grafana plugin proxy in Grafana >= v10.0.3.
Let's stop using the `latest`/`main` docker tags in our test and pin to
`10.0.2` for now
- ~~re-enables the e2e test which validates a phone number via SMS, and
asserts that we can receive an alert escalation via SMS (new Mailslurp
API Key has been added as a repo secret)~~ update: this is still blocked
by procurement, will be done in a future PR
## 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-22 19:03:29 +02:00
|
|
|
- celery/deployment.yaml
|
2023-08-24 13:12:24 +06:00
|
|
|
- telegram-polling/deployment.yaml
|
2023-05-26 19:50:24 +06:00
|
|
|
release:
|
|
|
|
|
name: oncall
|
|
|
|
|
tests:
|
2023-06-12 09:34:36 +06:00
|
|
|
- it: postgresql.enabled=false -> external PostgreSQL default settings
|
2023-05-26 19:50:24 +06:00
|
|
|
set:
|
2023-08-24 13:12:24 +06:00
|
|
|
telegramPolling.enabled: true
|
2023-05-26 19:50:24 +06:00
|
|
|
database.type: postgresql
|
|
|
|
|
postgresql.enabled: false
|
2023-06-22 22:43:05 -07:00
|
|
|
externalPostgresql.host: custom-postgres-host
|
2023-05-26 19:50:24 +06:00
|
|
|
asserts:
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_TYPE
|
|
|
|
|
value: postgresql
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_NAME
|
|
|
|
|
value: oncall
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_PORT
|
|
|
|
|
value: "5432"
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_USER
|
|
|
|
|
value: postgres
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_HOST
|
2023-06-22 22:43:05 -07:00
|
|
|
value: custom-postgres-host
|
2023-05-26 19:50:24 +06:00
|
|
|
|
2023-06-12 09:34:36 +06:00
|
|
|
- it: externalPostgresql -> should use external PostgreSQL custom settings
|
2023-05-26 19:50:24 +06:00
|
|
|
set:
|
2023-08-24 13:12:24 +06:00
|
|
|
telegramPolling.enabled: true
|
2023-05-26 19:50:24 +06:00
|
|
|
database.type: postgresql
|
|
|
|
|
postgresql.enabled: false
|
|
|
|
|
externalPostgresql:
|
|
|
|
|
host: test-host
|
|
|
|
|
port: 5555
|
|
|
|
|
db_name: grafana_oncall
|
|
|
|
|
user: test_user
|
|
|
|
|
asserts:
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_TYPE
|
|
|
|
|
value: postgresql
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_NAME
|
|
|
|
|
value: grafana_oncall
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_PORT
|
|
|
|
|
value: "5555"
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_USER
|
|
|
|
|
value: test_user
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_HOST
|
|
|
|
|
value: test-host
|
|
|
|
|
|
2023-10-03 15:25:28 +02:00
|
|
|
- it: externalPostgresql -> should use external PostgreSQL custom settings with additional options
|
|
|
|
|
set:
|
|
|
|
|
telegramPolling.enabled: true
|
|
|
|
|
database.type: postgresql
|
|
|
|
|
postgresql.enabled: false
|
|
|
|
|
externalPostgresql:
|
|
|
|
|
host: test-host
|
|
|
|
|
port: 5555
|
|
|
|
|
db_name: grafana_oncall
|
|
|
|
|
user: test_user
|
|
|
|
|
options: "sslmode=verify-full sslrootcert=/mnt/ca.crt sslcert=/mnt/client.crt sslkey=/mnt/client.key"
|
|
|
|
|
asserts:
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_OPTIONS
|
|
|
|
|
value: sslmode=verify-full sslrootcert=/mnt/ca.crt sslcert=/mnt/client.crt sslkey=/mnt/client.key
|
|
|
|
|
|
2023-06-12 09:34:36 +06:00
|
|
|
- it: postgresql.enabled=true -> internal PostgreSQL default settings
|
2023-05-26 19:50:24 +06:00
|
|
|
set:
|
2023-08-24 13:12:24 +06:00
|
|
|
telegramPolling.enabled: true
|
2023-05-26 19:50:24 +06:00
|
|
|
database.type: postgresql
|
|
|
|
|
postgresql.enabled: true
|
|
|
|
|
asserts:
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_TYPE
|
|
|
|
|
value: postgresql
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_NAME
|
|
|
|
|
value: oncall
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_PORT
|
|
|
|
|
value: "5432"
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_USER
|
|
|
|
|
value: postgres
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_HOST
|
|
|
|
|
value: oncall-postgresql
|
|
|
|
|
|
2023-06-12 09:34:36 +06:00
|
|
|
- it: postgresql.auth -> should use internal PostgreSQL custom settings
|
2023-05-26 19:50:24 +06:00
|
|
|
set:
|
2023-08-24 13:12:24 +06:00
|
|
|
telegramPolling.enabled: true
|
2023-05-26 19:50:24 +06:00
|
|
|
database.type: postgresql
|
|
|
|
|
postgresql:
|
|
|
|
|
enabled: true
|
|
|
|
|
auth:
|
|
|
|
|
database: grafana_oncall
|
|
|
|
|
username: grafana_oncall
|
|
|
|
|
asserts:
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_TYPE
|
|
|
|
|
value: postgresql
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_NAME
|
|
|
|
|
value: grafana_oncall
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_PORT
|
|
|
|
|
value: "5432"
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_USER
|
|
|
|
|
value: grafana_oncall
|
|
|
|
|
- contains:
|
|
|
|
|
path: spec.template.spec.containers[0].env
|
|
|
|
|
content:
|
|
|
|
|
name: DATABASE_HOST
|
|
|
|
|
value: oncall-postgresql
|