From bd6954f80fbbf53548aef7e3fcf546a7863de97a Mon Sep 17 00:00:00 2001 From: QuantumEnigmaa Date: Mon, 16 Sep 2024 12:34:59 +0200 Subject: [PATCH] add check script --- tests/manual_e2e/README.md | 5 ++--- tests/manual_e2e/basic_checks.sh | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100755 tests/manual_e2e/basic_checks.sh diff --git a/tests/manual_e2e/README.md b/tests/manual_e2e/README.md index 3928d62c..5fc1dbde 100644 --- a/tests/manual_e2e/README.md +++ b/tests/manual_e2e/README.md @@ -6,12 +6,11 @@ As of now, the [apptest-framework](https://github.com/giantswarm/apptest-framewo Before proceeding to any kind of test, you'll first have to deploy your custom branch app's version into a testing installation. Don't forget to suspend flux reconciliation for this app during the whole testing process. See [here](https://intranet.giantswarm.io/docs/dev-and-releng/flux/suspending-flux/#how-to-be-more-granular--subtle-with-suspending-resources-and-why-be-careful-with-this) for details on how to evict an app from flux's reconciliation. -Obviously you'll have to check that the deployment of your custom branch's version has gone smoothly. If the app is in a different state than `deployed` please describe the app and try to fix it according to the displayed events' description. +Once that's done, please run the `basic_checks.sh` script which will check that the app is in `deployed` state and that the `loki-canary` component is enabled. -Once your app is correctly deployed, : +Once your app is correctly deployed and configured : - Let it run for a bit, like 10min or more. -- Make sure that the `loki-canary` component is enabled and deployed. If not, please create a user values configmap on the installation to enable the canary. - Inspect the `Loki / Operational` dasboard which will give information on Loki's overall health. - If everything appears to be fine, then you can revert the flux's evicting procedure that you did and let it reconcile to its original version. diff --git a/tests/manual_e2e/basic_checks.sh b/tests/manual_e2e/basic_checks.sh new file mode 100755 index 00000000..9fbb5b00 --- /dev/null +++ b/tests/manual_e2e/basic_checks.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +echo "Checking if loki app is in deployed state" + +deployed=$(kubectl get app -n giantswarm loki -o yaml | yq .status.release.status) + +if [[ "$deployed" != "deployed" ]]; then + echo "loki app is not in deployed state. Please fix the app before retrying" + exit 1 +else + echo "loki app is indeed in deployed state" +fi + +echo "Checking if loki-canary is enabled" + +canary=$(kubectl get cm -n giantswarm loki-chart-values -oyaml | yq .data.values | yq .loki.lokiCanary.enabled) + +if [[ "$canary" != "true" ]]; then + echo "loki-canary is not enabled. Please enable it before retrying" + exit 1 +else + echo "loki-canary is indeed enabled" +fi