fix failing helm unit tests (#2727)
This commit is contained in:
parent
0da2122a50
commit
8eacbf2500
17 changed files with 46 additions and 36 deletions
9
.github/workflows/linting-and-tests.yml
vendored
9
.github/workflows/linting-and-tests.yml
vendored
|
|
@ -129,10 +129,13 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: d3adb5/helm-unittest-action@v2
|
||||
- uses: azure/setup-helm@v3
|
||||
with:
|
||||
helm-version: v3.8.0
|
||||
charts: ./helm/oncall
|
||||
version: v3.8.0
|
||||
- name: Install helm unittest plugin
|
||||
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version=v0.3.3
|
||||
- name: Run tests
|
||||
run: helm unittest ./helm/oncall
|
||||
|
||||
unit-test-backend-mysql-rabbitmq:
|
||||
name: "Backend Tests: MySQL + RabbitMQ (RBAC enabled: ${{ matrix.rbac_enabled }})"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
topologySpreadConstraints -> should use custom topologySpreadConstraints:
|
||||
1: |
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
2: |
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
|
|
@ -9,7 +9,7 @@ tests:
|
|||
- it: affinity={} -> should set afffinity null
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.affinity
|
||||
path: spec.template.spec.affinity
|
||||
|
||||
- it: affinity -> should use custom affinity
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tests:
|
|||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers
|
||||
count : 1
|
||||
count: 1
|
||||
|
||||
- it: celery.extraContainers -> should add sidecar containers
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tests:
|
|||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers
|
||||
count : 1
|
||||
count: 1
|
||||
|
||||
- it: engine.extraContainers -> should add sidecar containers
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ tests:
|
|||
- equal:
|
||||
path: spec.template.spec.containers[0].imagePullPolicy
|
||||
value: IfNotPresent
|
||||
|
||||
|
|
|
|||
|
|
@ -22,4 +22,3 @@ tests:
|
|||
path: spec.template.spec.imagePullSecrets
|
||||
content:
|
||||
name: regcred
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ tests:
|
|||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers
|
||||
count : 1
|
||||
count: 1
|
||||
|
||||
- it: migrate.extraContainers -> should add sidecar containers
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tests:
|
|||
- it: nodeSelector={} -> should set nodeSelector null
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.nodeSelector
|
||||
path: spec.template.spec.nodeSelector
|
||||
|
||||
- it: nodeSelector -> should use custom nodeSelector
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ tests:
|
|||
- it: priorityClassName="" -> should exclude priorityClassName
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.priorityClassName
|
||||
path: spec.template.spec.priorityClassName
|
||||
|
||||
- it: priorityClassName -> should use the custom priorityClassName
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ tests:
|
|||
secretKeyRef:
|
||||
key: redis-password
|
||||
name: oncall-redis
|
||||
|
||||
|
||||
- it: redis.enabled=false -> should fail if host not set
|
||||
set:
|
||||
redis.enabled: false
|
||||
|
|
|
|||
|
|
@ -27,4 +27,3 @@ tests:
|
|||
- equal:
|
||||
path: spec.template.spec.serviceAccountName
|
||||
value: custom
|
||||
|
||||
|
|
|
|||
|
|
@ -52,4 +52,3 @@ tests:
|
|||
secretKeyRef:
|
||||
name: some-secret
|
||||
key: token
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ tests:
|
|||
- it: tolerations={} -> should set tolerations null
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.tolerations
|
||||
path: spec.template.spec.tolerations
|
||||
|
||||
- it: tolerations -> should use custom tolerations
|
||||
set:
|
||||
|
|
|
|||
|
|
@ -8,26 +8,26 @@ tests:
|
|||
- it: topologySpreadConstraints=[] -> should exclude topologySpreadConstraints
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.topologySpreadConstraints
|
||||
path: spec.template.spec.topologySpreadConstraints
|
||||
|
||||
- it: topologySpreadConstraints -> should use custom topologySpreadConstraints
|
||||
set:
|
||||
engine:
|
||||
topologySpreadConstraints:
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
celery:
|
||||
topologySpreadConstraints:
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/component: engine
|
||||
maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
asserts:
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec.topologySpreadConstraints
|
||||
|
|
|
|||
|
|
@ -45,6 +45,3 @@ tests:
|
|||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: UWSGI_LISTEN
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ tests:
|
|||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers
|
||||
|
|
@ -39,8 +39,8 @@ tests:
|
|||
cpu: 100m
|
||||
memory: 128Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers
|
||||
|
|
@ -54,4 +54,3 @@ tests:
|
|||
value: postgresql
|
||||
- matchSnapshot:
|
||||
path: spec.template.spec.initContainers
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue