fix failing helm unit tests (#2727)

This commit is contained in:
Joey Orlando 2023-08-02 14:22:31 +02:00 committed by GitHub
parent 0da2122a50
commit 8eacbf2500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 46 additions and 36 deletions

View file

@ -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 }})"

View file

@ -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

View file

@ -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:

View file

@ -10,7 +10,7 @@ tests:
asserts:
- lengthEqual:
path: spec.template.spec.containers
count : 1
count: 1
- it: celery.extraContainers -> should add sidecar containers
set:

View file

@ -10,7 +10,7 @@ tests:
asserts:
- lengthEqual:
path: spec.template.spec.containers
count : 1
count: 1
- it: engine.extraContainers -> should add sidecar containers
set:

View file

@ -30,4 +30,3 @@ tests:
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: IfNotPresent

View file

@ -22,4 +22,3 @@ tests:
path: spec.template.spec.imagePullSecrets
content:
name: regcred

View file

@ -10,7 +10,7 @@ tests:
asserts:
- lengthEqual:
path: spec.template.spec.containers
count : 1
count: 1
- it: migrate.extraContainers -> should add sidecar containers
set:

View file

@ -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:

View file

@ -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:

View file

@ -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

View file

@ -27,4 +27,3 @@ tests:
- equal:
path: spec.template.spec.serviceAccountName
value: custom

View file

@ -52,4 +52,3 @@ tests:
secretKeyRef:
name: some-secret
key: token

View file

@ -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:

View file

@ -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

View file

@ -45,6 +45,3 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: UWSGI_LISTEN

View file

@ -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