Skip to content

Commit 2bcaddf

Browse files
committed
test(vpn): add default render helm unit tests
vpn was one of the remaining user-facing apps with no helm-unittest coverage. Signed-off-by: Akanksha Trehun <[email protected]>
1 parent 56e10b1 commit 2bcaddf

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎packages/apps/vpn/Makefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
include ../../../hack/package.mk
22

3+
.PHONY: test
4+
test:
5+
helm unittest .
6+
37
generate:
48
cozyvalues-gen -m 'vpn' -v values.yaml -s values.schema.json -r README.md -g ../../../api/apps/v1alpha1/vpn/types.go
59
../../../hack/update-crd.sh
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
suite: vpn default render
2+
3+
# Both templates are loaded so the Deployment's checksum/config annotation can
4+
# resolve its include of secret.yaml; template: pins assertions to the
5+
# Deployment document alone.
6+
templates:
7+
- templates/deployment.yaml
8+
- templates/secret.yaml
9+
10+
release:
11+
name: vpn-test
12+
namespace: tenant-test
13+
14+
set:
15+
_namespace:
16+
host: example.com
17+
18+
tests:
19+
- it: renders a Deployment with the default replicas and image
20+
template: templates/deployment.yaml
21+
asserts:
22+
- hasDocuments:
23+
count: 1
24+
- isKind:
25+
of: Deployment
26+
- equal:
27+
path: metadata.name
28+
value: vpn-test-vpn
29+
- equal:
30+
path: spec.replicas
31+
value: 2
32+
- equal:
33+
path: spec.template.spec.containers[0].image
34+
value: "quay.io/outline/shadowbox:stable"
35+
- equal:
36+
path: spec.template.spec.containers[0].ports[0].containerPort
37+
value: 40000

0 commit comments

Comments
 (0)