mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Merge pull request #9068 from mknet3/helm-unittest
ci: add helm unittest
This commit is contained in:
commit
12b37d2eee
2 changed files with 81 additions and 0 deletions
27
.github/workflows/helm_unit_test.yml
vendored
Normal file
27
.github/workflows/helm_unit_test.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
name: Helm unit test
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Helm 3.11.1
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: '3.11.1'
|
||||||
|
|
||||||
|
- name: Install Helm Unit Test Plugin
|
||||||
|
run: |
|
||||||
|
helm plugin install https://github.com/helm-unittest/helm-unittest --version v0.4.4
|
||||||
|
|
||||||
|
- name: Run unit tests
|
||||||
|
run:
|
||||||
|
helm unittest -f 'tests/*.yaml' deploy/charts/litellm-helm
|
54
deploy/charts/litellm-helm/tests/deployment_tests.yaml
Normal file
54
deploy/charts/litellm-helm/tests/deployment_tests.yaml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
suite: test deployment
|
||||||
|
templates:
|
||||||
|
- deployment.yaml
|
||||||
|
- configmap-litellm.yaml
|
||||||
|
tests:
|
||||||
|
- it: should work
|
||||||
|
template: deployment.yaml
|
||||||
|
set:
|
||||||
|
image.tag: test
|
||||||
|
asserts:
|
||||||
|
- isKind:
|
||||||
|
of: Deployment
|
||||||
|
- matchRegex:
|
||||||
|
path: metadata.name
|
||||||
|
pattern: -litellm$
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[0].image
|
||||||
|
value: ghcr.io/berriai/litellm-database:test
|
||||||
|
- it: should work with tolerations
|
||||||
|
template: deployment.yaml
|
||||||
|
set:
|
||||||
|
tolerations:
|
||||||
|
- key: node-role.kubernetes.io/master
|
||||||
|
operator: Exists
|
||||||
|
effect: NoSchedule
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.tolerations[0].key
|
||||||
|
value: node-role.kubernetes.io/master
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.tolerations[0].operator
|
||||||
|
value: Exists
|
||||||
|
- it: should work with affinity
|
||||||
|
template: deployment.yaml
|
||||||
|
set:
|
||||||
|
affinity:
|
||||||
|
nodeAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: topology.kubernetes.io/zone
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- antarctica-east1
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key
|
||||||
|
value: topology.kubernetes.io/zone
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator
|
||||||
|
value: In
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0]
|
||||||
|
value: antarctica-east1
|
Loading…
Add table
Add a link
Reference in a new issue