From 6962bbb1db809f1aecf6cee9bfdea7115f5202f4 Mon Sep 17 00:00:00 2001 From: Frank Hamand Date: Mon, 2 Oct 2023 11:10:42 +0100 Subject: [PATCH] Add tests for readinessGates --- charts/posthog/tests/events-deployment.yaml | 16 +++++++++++ .../posthog/tests/recordings-deployment.yaml | 16 +++++++++++ charts/posthog/tests/web-deployment.yaml | 28 +++++++++++++++++++ 3 files changed, 60 insertions(+) diff --git a/charts/posthog/tests/events-deployment.yaml b/charts/posthog/tests/events-deployment.yaml index 071602192..4a2877bcf 100644 --- a/charts/posthog/tests/events-deployment.yaml +++ b/charts/posthog/tests/events-deployment.yaml @@ -251,5 +251,21 @@ tests: path: spec.template.spec.imagePullSecrets value: [name: secret] + - it: allows setting readinessGates + template: templates/events-deployment.yaml # TODO: remove once secrets.yaml will be fixed/removed + set: + cloud: local + image.pullSecrets: [secret] + events.enabled: true + events: + readinessGates: + - conditionType: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_events_8000 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.template.spec.readinessGates[0].conditionType + value: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_events_8000 + diff --git a/charts/posthog/tests/recordings-deployment.yaml b/charts/posthog/tests/recordings-deployment.yaml index 5098b0639..e81758c6f 100644 --- a/charts/posthog/tests/recordings-deployment.yaml +++ b/charts/posthog/tests/recordings-deployment.yaml @@ -263,3 +263,19 @@ tests: - equal: path: spec.template.spec.imagePullSecrets value: [name: secret] + + - it: allows setting readinessGates + template: templates/events-deployment.yaml # TODO: remove once secrets.yaml will be fixed/removed + set: + cloud: local + image.pullSecrets: [secret] + recordings.enabled: true + recordings: + readinessGates: + - conditionType: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_recordings_8000 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.template.spec.readinessGates[0].conditionType + value: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_recordings_8000 diff --git a/charts/posthog/tests/web-deployment.yaml b/charts/posthog/tests/web-deployment.yaml index 27d8482f4..fdf28c135 100644 --- a/charts/posthog/tests/web-deployment.yaml +++ b/charts/posthog/tests/web-deployment.yaml @@ -167,3 +167,31 @@ tests: content: name: POSTHOG_POSTGRES_READ_HOST value: beep-boop + + - it: allows setting readinessGates + template: templates/web-deployment.yaml # TODO: remove once secrets.yaml will be fixed/removed + set: + cloud: local + image.pullSecrets: [secret] + web.enabled: true + web: + readinessGates: + - conditionType: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_web_8000 + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.template.spec.readinessGates[0].conditionType + value: target-health.alb.ingress.k8s.aws/posthog_ingress_posthog_web_8000 + + - it: has no default readinessGates + template: templates/web-deployment.yaml # TODO: remove once secrets.yaml will be fixed/removed + set: + cloud: local + image.pullSecrets: [secret] + web.enabled: true + asserts: + - hasDocuments: + count: 1 + - isEmpty: + path: spec.template.spec.readinessGates