Skip to content

Commit

Permalink
add tests for the startup/liveness/readiness probes
Browse files Browse the repository at this point in the history
  • Loading branch information
jforest committed Dec 4, 2024
1 parent 7cc985c commit 6bae130
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions ci/rstudio-workbench/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,3 +618,75 @@ tests:
value: "1024Mi"
- notExists:
path: 'spec.template.spec.containers[0].resources.requests'
- it: should configure the livenessProbe if values.livenessProbe.enabled is true
template: deployment.yaml
set:
livenessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- equal:
path: 'spec.template.spec.containers[0].livenessProbe.initialDelaySeconds'
value: 10
- equal:
path: 'spec.template.spec.containers[0].livenessProbe.periodSeconds'
value: 20
- it: should not configure the livenessProbe if values.livenessProbe.enabled is false
template: deployment.yaml
set:
livenessProbe:
enabled: false
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- notExists:
path: 'spec.template.spec.containers[0].livenessProbe'
- it: should configure the startupProbe if values.startupsProbe.enabled is true
template: deployment.yaml
set:
startupProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- equal:
path: 'spec.template.spec.containers[0].startupProbe.initialDelaySeconds'
value: 10
- equal:
path: 'spec.template.spec.containers[0].startupProbe.periodSeconds'
value: 20
- it: should not configure the startupProbe if values.startupProbe.enabled is false
template: deployment.yaml
set:
startupProbe:
enabled: false
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- notExists:
path: 'spec.template.spec.containers[0].startupProbe'
- it: should configure the readinessProbe if values.readinessProbe.enabled is true
template: deployment.yaml
set:
readinessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- equal:
path: 'spec.template.spec.containers[0].readinessProbe.initialDelaySeconds'
value: 10
- equal:
path: 'spec.template.spec.containers[0].readinessProbe.periodSeconds'
value: 20
- it: should not configure the readinessProbe if values.readinessProbe.enabled is false
template: deployment.yaml
set:
readinessProbe:
enabled: false
initialDelaySeconds: 10
periodSeconds: 20
asserts:
- notExists:
path: 'spec.template.spec.containers[0].readinessProbe'

0 comments on commit 6bae130

Please sign in to comment.