From 9149ad791781b1a4130ec2bfdaff0d024fa554d7 Mon Sep 17 00:00:00 2001 From: David Collom Date: Tue, 14 Nov 2023 11:08:35 -0600 Subject: [PATCH] Chore: More tests for secret.yaml (#134) --- .../version-checker/tests/secret_test.yaml | 91 ++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/deploy/charts/version-checker/tests/secret_test.yaml b/deploy/charts/version-checker/tests/secret_test.yaml index 0a949e9e..c006d8a1 100644 --- a/deploy/charts/version-checker/tests/secret_test.yaml +++ b/deploy/charts/version-checker/tests/secret_test.yaml @@ -7,7 +7,23 @@ 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: @@ -15,6 +31,42 @@ tests: 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 @@ -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"]