Skip to content

Commit

Permalink
Add secrets_test.yaml for testing secret object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawlowski committed Feb 15, 2024
1 parent 302312a commit c83a963
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions helm/flowforge/tests/secrets_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
suite: test secrets object
templates:
- secrets.yaml
tests:
- it: should create a secret object
set:
forge.domain: "chart-unit-tests.com"
forge.email.smtp:
host: smtp.gmail.com
password: ut-smtp-password
postgresql.auth:
username: ut-db-username
password: ut-db-password
asserts:
- hasDocuments:
count: 1
- isKind:
of: Secret
- it: should create a secret object with smtp password only
set:
forge.domain: "chart-unit-tests.com"
postgresql.auth.existingSecret: "fake-existing-db-secret"
forge.email.smtp:
host: smtp.gmail.com
password: fakePassword
asserts:
- hasDocuments:
count: 1
- isKind:
of: Secret
- isNotNullOrEmpty:
path: data.smtp-password
- notExists:
path: data.password
- it: should create a secret object with database password only
set:
forge.domain: "chart-unit-tests.com"
postgresql.auth:
username: ut-db-username
password: ut-db-password
forge.email.smtp:
host: smtp.gmail.com
existingSecret: "fake-existing-smtp-secret"
asserts:
- hasDocuments:
count: 1
- isKind:
of: Secret
- isNotNullOrEmpty:
path: data.password
- isNotNullOrEmpty:
path: data.postgres-password
- notExists:
path: data.smtp-password
- it: should not create the secret if both external ones are used
set:
forge.domain: "chart-unit-tests.com"
postgresql.auth.existingSecret: "fake-existing-db-secret"
forge.email.smtp:
host: smtp.gmail.com
existingSecret: "fake-existing-smtp-secret"
asserts:
- hasDocuments:
count: 0

0 comments on commit c83a963

Please sign in to comment.