Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created February 22, 2021 12:14
Show Gist options
  • Save wshihadeh/bde90e8237917dfa8568e4087232384e to your computer and use it in GitHub Desktop.
Save wshihadeh/bde90e8237917dfa8568e4087232384e to your computer and use it in GitHub Desktop.
Deployment Unit Tests
suite: Deployment configuration
templates:
- deployment.yaml
tests:
- it: should have 1 replica by default
asserts:
- equal:
path: spec.replicas
value: 1
- it: should have the specified amount of replicas when specified via values
set:
deployment:
replicas: 3
asserts:
- equal:
path: spec.replicas
value: 3
- it: should have a rollingUpdate strategy with default values
asserts:
- equal:
path: spec.strategy.type
value: RollingUpdate
- equal:
path: spec.strategy.rollingUpdate.maxUnavailable
value: 1
- equal:
path: spec.strategy.rollingUpdate.maxSurge
value: 1
- it: should have a custom merged rollingUpdate strategy with specified values
set:
rollingUpdate:
maxUnavailable: 4
vegetaForce: 9000
asserts:
- equal:
path: spec.strategy.type
value: RollingUpdate
- equal:
path: spec.strategy.rollingUpdate.maxUnavailable
value: 4
- equal:
path: spec.strategy.rollingUpdate.maxSurge
value: 1
- equal:
path: spec.strategy.rollingUpdate.vegetaForce
value: 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment