Skip to content

Commit

Permalink
Chore: More tests for secret.yaml (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcollom authored Nov 14, 2023
1 parent 3ffeab1 commit 9149ad7
Showing 1 changed file with 90 additions and 1 deletion.
91 changes: 90 additions & 1 deletion deploy/charts/version-checker/tests/secret_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,66 @@ tests:
- hasDocuments:
count: 0

- it: Only SelfHosted
- it: Object Defaults
set:
acr.refreshToken: sakjgnsa
docker.token: sajkgnaskj
ecr.accessKeyID: "21412"
asserts:
- equal:
path: type
value: Opaque
- isNotEmpty:
path: metadata.labels
- containsDocument:
apiVersion: v1
kind: Secret
name: version-checker

- it: Empty SelfHosted list
set:
selfHosted: []
asserts:
- hasDocuments:
count: 0

# ACR
- it: ACR
set:
acr.refreshToken: TOKEN
acr.username: USERNAME
acr.password: PASSWORD
asserts:
- hasDocuments:
count: 1
- equal:
path: data["acr.refreshToken"]
value: VE9LRU4=
- equal:
path: data["acr.username"]
value: VVNFUk5BTUU=
- equal:
path: data["acr.password"]
value: UEFTU1dPUkQ=

# Docker
- it: Docker
set:
docker.token: TOKEN
docker.username: USERNAME
docker.password: PASSWORD
asserts:
- hasDocuments:
count: 1
- equal:
path: data["docker.token"]
value: VE9LRU4=
- equal:
path: data["docker.username"]
value: VVNFUk5BTUU=
- equal:
path: data["docker.password"]
value: UEFTU1dPUkQ=

# GCR:
- it: GCR
Expand All @@ -37,3 +89,40 @@ tests:
- equal:
path: data["ghcr.token"]
value: YWFzZmFz

# SelfHosted:
- it: SelfHosted
set:
selfhosted:
- name: selfhosted1
host: localhost:8000
username: user
password: pass
- name: selfhosted2
host: localhost:5000
username: user2
token: token
asserts:
- hasDocuments:
count: 1
- equal:
path: data["selfhosted.selfhosted1.host"]
value: bG9jYWxob3N0OjgwMDA=
- equal:
path: data["selfhosted.selfhosted1.username"]
value: dXNlcg==
- equal:
path: data["selfhosted.selfhosted1.password"]
value: cGFzcw==

- equal:
path: data["selfhosted.selfhosted2.host"]
value: bG9jYWxob3N0OjUwMDA=
- equal:
path: data["selfhosted.selfhosted2.token"]
value: dG9rZW4=
- equal:
path: data["selfhosted.selfhosted2.username"]
value: dXNlcjI=
- notExists:
path: data["selfhosted.selfhosted2.password"]

0 comments on commit 9149ad7

Please sign in to comment.