-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Migrate `go test` to `helm unittest` - Migrate Trivy existing unit tests to `helm unittest` - Add unit tests for Core Signed-off-by: Carlos Vega <[email protected]>
- Loading branch information
1 parent
1569536
commit 42000ea
Showing
9 changed files
with
1,248 additions
and
173 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
suite: CoreConfigMap | ||
|
||
tests: | ||
- it: witTrivy | ||
set: | ||
trivy: | ||
enabled: true | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.WITH_TRIVY | ||
value: "true" | ||
|
||
- it: RedisUrlHarborInternal | ||
set: | ||
redis: | ||
internal: | ||
harborDatabaseIndex: test-index | ||
type: internal | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data._REDIS_URL_HARBOR | ||
value: redis://RELEASE-NAME-harbor-redis:6379/test-index?idle_timeout_seconds=30 | ||
|
||
- it: RedisUrlHarborExternal | ||
set: | ||
redis: | ||
external: | ||
harborDatabaseIndex: test-index | ||
type: external | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data._REDIS_URL_HARBOR | ||
value: redis://192.168.0.2:6379/test-index?idle_timeout_seconds=30 | ||
|
||
- it: CacheLayerDatabaseIndex | ||
set: | ||
redis: | ||
internal: | ||
cacheLayerDatabaseIndex: test-index | ||
type: internal | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data._REDIS_URL_CACHE_LAYER | ||
value: redis://RELEASE-NAME-harbor-redis:6379/test-index?idle_timeout_seconds=30 | ||
|
||
- it: RegsitryCredentialUsername | ||
set: | ||
registry: | ||
credentials: | ||
username: test-username | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.REGISTRY_CREDENTIAL_USERNAME | ||
value: test-username | ||
|
||
- it: UaaSecretName | ||
set: | ||
uaaSecretName: true | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.UAA_CA_ROOT | ||
value: /etc/core/auth-ca/auth-ca.crt | ||
|
||
- it: MetricEnabled | ||
set: | ||
metrics: | ||
enabled: true | ||
core: | ||
path: /customMetrics | ||
port: 8080 | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.METRIC_ENABLE | ||
value: "true" | ||
- equal: | ||
path: data.METRIC_PATH | ||
value: /customMetrics | ||
- equal: | ||
path: data.METRIC_PORT | ||
value: "8080" | ||
- equal: | ||
path: data.METRIC_NAMESPACE | ||
value: harbor | ||
- equal: | ||
path: data.METRIC_SUBSYSTEM | ||
value: core | ||
|
||
- it: GcTimeWindowHours | ||
set: | ||
core: | ||
gcTimeWindowHours: 2 | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.GC_TIME_WINDOW_HOURS | ||
value: "2" | ||
|
||
- it: GcTimeWindowHours | ||
set: | ||
core: | ||
artifactPullAsyncFlushDuration: 30 | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.ARTIFACT_PULL_ASYNC_FLUSH_DURATION | ||
value: "30" | ||
|
||
- it: GdprDeleteUser | ||
set: | ||
core: | ||
gdpr: | ||
deleteUser: true | ||
auditLogsCompliant: false | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.GDPR_DELETE_USER | ||
value: "true" | ||
- notExists: | ||
path: data.GDPR_AUDIT_LOGS | ||
|
||
- it: GdprAuditLogsCompliant | ||
set: | ||
core: | ||
gdpr: | ||
deleteUser: false | ||
auditLogsCompliant: true | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.GDPR_AUDIT_LOGS | ||
value: "true" | ||
- notExists: | ||
path: data.GDPR_DELETE_USER | ||
|
||
- it: GdprDeleteUserAuditLogsCompliant | ||
set: | ||
core: | ||
gdpr: | ||
deleteUser: true | ||
auditLogsCompliant: true | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.GDPR_DELETE_USER | ||
value: "true" | ||
- equal: | ||
path: data.GDPR_AUDIT_LOGS | ||
value: "true" | ||
|
||
- it: CacheEnabled | ||
set: | ||
cache: | ||
enabled: true | ||
expireHours: 3 | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.CACHE_ENABLED | ||
value: "true" | ||
- equal: | ||
path: data.CACHE_EXPIRE_HOURS | ||
value: "3" | ||
|
||
- it: CuotaUpdate | ||
set: | ||
core: | ||
quotaUpdateProvider: 3 | ||
template: templates/core/core-cm.yaml | ||
asserts: | ||
- equal: | ||
path: data.QUOTA_UPDATE_PROVIDER | ||
value: "3" |
Oops, something went wrong.