-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
163 changes: 163 additions & 0 deletions
163
charts/snyk-broker/tests/broker_deployment_apprisk_type_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json | ||
suite: broker deployment (apprisk type) | ||
chart: | ||
version: 0.0.0 | ||
values: | ||
- ./fixtures/default_values.yaml | ||
templates: | ||
- secrets.yaml | ||
- broker_deployment.yaml | ||
set: | ||
scmType: apprisk | ||
|
||
tests: | ||
- it: should create secrets if sonarqubeHostUrl is defined | ||
template: secrets.yaml | ||
set: | ||
sonarqubeHostUrl: https://mysonarqube | ||
sonarqubeApiToken: abc123 | ||
disableSuffixes: true | ||
asserts: | ||
|
||
- isKind: | ||
of: Secret | ||
documentSelector: | ||
path: metadata.name | ||
value: apprisk-sonarqube-api-token-release-name | ||
- equal: | ||
path: data | ||
value: YWJjMTIz | ||
documentSelector: | ||
path: metadata.name | ||
value: apprisk-sonarqube-api-token-release-name | ||
|
||
|
||
# - it: should create secrets if brokerClientValidationUrl and nexusUrl are defined | ||
# template: secrets.yaml | ||
|
||
# set: | ||
# nexusUrl: https://username:[email protected]/repository | ||
# brokerClientValidationUrl: https://username:[email protected]/service/rest/v1/status/check | ||
# disableSuffixes: true | ||
|
||
# asserts: | ||
|
||
# - isKind: | ||
# of: Secret | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-broker-client-validation-url | ||
# - equal: | ||
# path: data.nexus-broker-client-validation-url | ||
# value: aHR0cHM6Ly91c2VybmFtZTpwYXNzd29yZEB5b3VyLWRvbWFpbi5jb20vc2VydmljZS9yZXN0L3YxL3N0YXR1cy9jaGVjaw== | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-broker-client-validation-url | ||
|
||
# - isKind: | ||
# of: Secret | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-nexus-url | ||
# - equal: | ||
# path: data.nexus-nexus-url | ||
# value: aHR0cHM6Ly91c2VybmFtZTpwYXNzd29yZEB5b3VyLWRvbWFpbi5jb20vcmVwb3NpdG9yeQ== | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-nexus-url | ||
|
||
# - containsDocument: | ||
# kind: Secret | ||
# apiVersion: v1 | ||
# name: nexus-nexus-base-url | ||
# not: true | ||
|
||
# - it: should create secrets if brokerClientValidationUrl and baseNexusUrl are defined | ||
# template: secrets.yaml | ||
|
||
# set: | ||
# baseNexusUrl: https://username:[email protected] | ||
# brokerClientValidationUrl: https://username:[email protected]/service/rest/v1/status/check | ||
# disableSuffixes: true | ||
|
||
# asserts: | ||
|
||
# - isKind: | ||
# of: Secret | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-broker-client-validation-url | ||
# - equal: | ||
# path: data.nexus-broker-client-validation-url | ||
# value: aHR0cHM6Ly91c2VybmFtZTpwYXNzd29yZEB5b3VyLWRvbWFpbi5jb20vc2VydmljZS9yZXN0L3YxL3N0YXR1cy9jaGVjaw== | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-broker-client-validation-url | ||
|
||
# - isKind: | ||
# of: Secret | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-base-nexus-url | ||
# - equal: | ||
# path: data.nexus-base-nexus-url | ||
# value: aHR0cHM6Ly91c2VybmFtZTpwYXNzd29yZEB5b3VyLWRvbWFpbi5jb20= | ||
# documentSelector: | ||
# path: metadata.name | ||
# value: nexus-base-nexus-url | ||
|
||
# - containsDocument: | ||
# kind: Secret | ||
# apiVersion: v1 | ||
# name: nexus-nexus-url | ||
# not: true | ||
|
||
# - it: should not create secret for brokerClientValidationUrl if value is empty | ||
# template: secrets.yaml | ||
|
||
# set: | ||
# nexusUrl: https://username:[email protected]/repository | ||
# baseNexusUrl: https://username:[email protected] | ||
# disableSuffixes: true | ||
|
||
# asserts: | ||
# - containsDocument: | ||
# kind: Secret | ||
# apiVersion: v1 | ||
# name: nexus-broker-client-validation-url | ||
# not: true | ||
|
||
# - it: references secrets in deployment | ||
# release: | ||
# name: unittest | ||
# template: broker_deployment.yaml | ||
# set: | ||
# baseNexusUrl: https://username:[email protected] | ||
# nexusUrl: https://username:[email protected]/repository | ||
# brokerClientValidationUrl: https://username:[email protected]/service/rest/v1/status/check | ||
|
||
# asserts: | ||
# - contains: | ||
# path: spec.template.spec.containers[0].env | ||
# content: | ||
# name: BASE_NEXUS_URL | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: nexus-base-nexus-url-unittest | ||
# key: "nexus-base-nexus-url" | ||
# - contains: | ||
# path: spec.template.spec.containers[0].env | ||
# content: | ||
# name: NEXUS_URL | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: nexus-nexus-url-unittest | ||
# key: "nexus-nexus-url" | ||
# - contains: | ||
# path: spec.template.spec.containers[0].env | ||
# content: | ||
# name: BROKER_CLIENT_VALIDATION_URL | ||
# valueFrom: | ||
# secretKeyRef: | ||
# name: nexus-broker-client-validation-url-unittest | ||
# key: "nexus-broker-client-validation-url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters