Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karitham committed Jul 17, 2024
1 parent b213868 commit da3e38c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: d3adb5/helm-unittest-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
charts: ./charts/wga
5 changes: 5 additions & 0 deletions charts/wga/tests/defaultValues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
endpoint:
address: 192.168.1.1
privateKeySecretName: wga-key
unbound:
ip: 192.168.1.53
6 changes: 2 additions & 4 deletions charts/wga/tests/endpoint_test.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
suite: test default image tags
templates:
- endpoint/deployment.yaml
values:
- defaultValues.yaml
tests:
- it: default image tags should equal to current appVersion
chart:
appVersion: 0.6.2
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
asserts:
- equal:
path: spec.template.spec.containers[0].image
Expand Down
12 changes: 2 additions & 10 deletions charts/wga/tests/unbound_test.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
suite: unbound
templates:
- unbound/service.yaml
values:
- defaultValues.yaml
tests:
- it: should set custom annotations for unbound service
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
unbound.service.annotations:
custom.annotation/test: "test-value"
another.annotation/example: "example-value"
Expand All @@ -18,19 +17,12 @@ tests:
another.annotation/example: "example-value"

- it: should not any annotation by default
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
asserts:
- isNullOrEmpty:
path: metadata.annotations

- it: should set metallb annotation when specified
set:
endpoint.address: 192.168.1.1
endpoint.privateKeySecretName: wga-key
unbound.ip: 192.168.1.53
unbound.service.annotations:
metallb.universe.tf/loadBalancerIPs: "192.168.1.53"
asserts:
Expand Down

0 comments on commit da3e38c

Please sign in to comment.