Skip to content

Commit

Permalink
Add tests for readinessGates
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh committed Oct 2, 2023
1 parent 5873d74 commit 6962bbb
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
16 changes: 16 additions & 0 deletions charts/posthog/tests/events-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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



16 changes: 16 additions & 0 deletions charts/posthog/tests/recordings-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 28 additions & 0 deletions charts/posthog/tests/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 6962bbb

Please sign in to comment.