Skip to content

Commit

Permalink
chore(uplink) fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed Sep 19, 2023
1 parent 9d6261b commit 7d03f9b
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 81 deletions.
41 changes: 0 additions & 41 deletions charts/uplink/templates/tests/custom_values_test.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions charts/uplink/templates/tests/defaults_test.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions charts/uplink/templates/tests/test-connection.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions charts/uplink/tests/custom_values_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
suite: test secret.yaml
templates:
- secret.yaml
set:
postgresql:
url: "example-url"
client:
id: "example-id"
secret: "example-secret"
sentry.dsn: "example-dsn"
tests:
- it: should ensure the secret is created with custom credentials
asserts:
- isKind:
of: Secret
- equal:
path: metadata.name
value: RELEASE-NAME-uplink
- equal:
path: data['postgresql.url']
value: "ZXhhbXBsZS11cmw=" # Base64 encoded value of "example-url"
- equal:
path: data['client.id']
value: "ZXhhbXBsZS1pZA==" # Base64 encoded value of "example-id"
- equal:
path: data['client.secret']
value: "ZXhhbXBsZS1zZWNyZXQ=" # Base64 encoded value of "example-secret"
- equal:
path: data['sentry.dsn']
value: "ZXhhbXBsZS1kc24=" # Base64 encoded value of "example-dsn"
19 changes: 19 additions & 0 deletions charts/uplink/tests/defaults_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
suite: test default behavior of secret.yaml with default values
templates:
- secret.yaml
tests:
- it: should render with default values without error
asserts:
- isKind:
of: Secret
- equal:
path: metadata.name
value: RELEASE-NAME-uplink
- notExists:
path: data.postgresql.url
- notExists:
path: data.client.id
- notExists:
path: data.client.secret
- notExists:
path: data.sentry.dsn

0 comments on commit 7d03f9b

Please sign in to comment.