oncall-engine/helm/README.md

61 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

# How to run the chart locally
1. Create the cluster with [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
> Make sure ports 30001, 30002 (Grafana, optional) are available
```bash
kind create cluster --image kindest/node:v1.24.7 --config kind.yml
```
2023-01-12 22:32:53 +08:00
2. (Optional) Build oncall image locally and load it to kind cluster
2023-01-12 18:37:14 +00:00
```bash
docker build ../engine -t oncall/engine:latest --target dev
kind load docker-image oncall/engine:latest
2023-01-12 22:32:53 +08:00
```
Also make sure to add the following lines to your `simple.yml` (you may also need to enable `devMode`):
```yaml
image:
repository: oncall/engine
tag: latest
pullPolicy: IfNotPresent
oncall:
devMode: true
```
Alternatively you can also pass an extra `--values ./local_image.yml` in the command below.
3. Install the helm chart
```bash
first UI integration test - phone verification + receive SMS alert flow (#900) **What this PR does**: Adds our first UI integration test using [Playwright](https://playwright.dev/) and runs the test on CI. Right now the test: - logs into Grafana - configures the plugin (if it isn't already) - creates an OnCall schedule, where the current user will be OnCall - creates an escalation chain to notify based on the newly created OnCall schedule - creates a webhook integration, attached to the created escalation chain - sends a demo alert for the new integration - goes to the alert groups page and validates that the escalation step to alert the OnCall user actually happened Currently the Playwright tests are run against the 3 default headless browsers, chromium, Firefox, and webkit. The CI job that runs these tests is run as a matrix against 3 tagged versions of `grafana`; `main`, `latest`, and `9.2.6`. Secondly, it adds most of the logic for a second test which: - logs into Grafana - configures the plugin (if it isn't already) - goes to the user's settings, verifies their phone number (using a tool called [MailSlurp](https://www.mailslurp.com/)) - configures the current user's default escalation policy to send alerts via SMS - creates an escalation policy and configures it to send alerts to our current user - creates an integration and assigns the created escalation policy - triggers a test alert + verifies that we receive the SMS alert text (again, using MailSlurp) **Which issue(s) this PR fixes**: Closes #873 **Checklist** - [x] Tests updated - [ ] Documentation added (N/A) - [ ] `CHANGELOG.md` updated (N/A)
2023-03-06 17:28:52 +01:00
helm install helm-testing \
--wait \
--values ./simple.yml \
./oncall
```
4. Get credentials
```bash
echo "\n\nOpen Grafana on localhost:30002 with credentials - user: admin, password: $(kubectl get secret --namespace default helm-testing-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo)"
2023-01-12 22:32:53 +08:00
echo "Open Plugins -> Grafana OnCall -> fill form: backend url: http://host.docker.internal:30001"
```
5. Clean up
If you happen to `helm uninstall helm-testing` be sure to delete all the Persistent Volume Claims, as Postgres stores
the auto-generated password on disk, and the next `helm install` will fail.
```bash
kubectl delete pvc --all
kubectl delete pv --all
```
This, of course, will delete all the PVs and PVCs also :-)
```bash
kind delete cluster
```