Skip to content

Commit

Permalink
adding some helm tests and snapshost
Browse files Browse the repository at this point in the history
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
  • Loading branch information
Skarlso committed Aug 13, 2024
1 parent 71efc43 commit eecf827
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ jobs:
run: make lint
- name: Run tests
run: make test-ci
- name: Run helm test
run: make helm-test
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ test-ci: ## Test the project
prime-test-cluster: mkcert
./hack/prime_test_cluster.sh

helm.test:
@helm unittest --file tests/*.yaml --file 'tests/**/*.yaml' deploy/charts/bitwarden-sdk-server/

helm.test.update:
@helm unittest -u --file tests/*.yaml --file 'tests/**/*.yaml' deploy/charts/bitwarden-sdk-server/

##@ Docker

IMG ?= ghcr.io/external-secrets/bitwarden-sdk-server
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
deployment should match snapshot:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: bitwarden-sdk-server
app.kubernetes.io/version: 1.16.0
helm.sh/chart: bitwarden-sdk-server-0.1.0
name: bitwarden-sdk-server
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: bitwarden-sdk-server
template:
metadata:
labels:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: bitwarden-sdk-server
spec:
containers:
- image: ghcr.io/external-secrets/bitwarden-sdk-server:v0.8.0
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /live
port: http
scheme: HTTPS
name: bitwarden-sdk-server
ports:
- containerPort: 9998
name: http
protocol: TCP
readinessProbe:
httpGet:
path: /ready
port: http
scheme: HTTPS
resources: {}
securityContext: {}
volumeMounts:
- mountPath: /certs
name: bitwarden-tls-certs
securityContext: {}
serviceAccountName: bitwarden-sdk-server
volumes:
- name: bitwarden-tls-certs
secret:
items:
- key: tls.crt
path: cert.pem
- key: tls.key
path: key.pem
- key: ca.crt
path: ca.pem
secretName: bitwarden-tls-certs
9 changes: 9 additions & 0 deletions deploy/charts/bitwarden-sdk-server/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
suite: test deployment
templates:
- deployment.yaml
tests:
- it: deployment should match snapshot
set:
image.tag: v0.8.0
asserts:
- matchSnapshot: {}

0 comments on commit eecf827

Please # to comment.