-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create unit tests for Core #1787
Conversation
6e91857
to
42000ea
Compare
- 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]>
42000ea
to
1da7ed5
Compare
path: data.GC_TIME_WINDOW_HOURS | ||
value: "2" | ||
|
||
- it: GcTimeWindowHours |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 105, GcTimeWindowHours
may need to be changed to a different value, as it is used in line 95 and not related to its context.
path: data.CACHE_EXPIRE_HOURS | ||
value: "3" | ||
|
||
- it: CuotaUpdate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CuotaUpdate
has a typo here.
- it: PodAnnotations | ||
set: | ||
core: | ||
podAnnotations: | ||
test.annotation: test-annotation | ||
template: templates/core/core-dpl.yaml | ||
asserts: | ||
- equal: | ||
path: spec.template.metadata.annotations["test.annotation"] | ||
value: test-annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 26 - line35 is a duplicate of line 15 - line24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the duplicated tests and renamed the wrong ones.
test/unittest/core_secret_test.yaml
Outdated
- notExists: | ||
path: data.HARBOR_ADMIN_PASSWORD | ||
|
||
- it: ExistingDBSecret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe change this ExistingDBSecret
to ExistingExternalDBSecret
?
test/unittest/core_svc_test.yaml
Outdated
- notExists: | ||
path: spec.type | ||
|
||
- it: ExposeTLSEnabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ExposeTLSEnabled
can be misunderstood as expose.tls.enabled
, maybe change it to InternalTLSEnabled
?
test/unittest/core_svc_test.yaml
Outdated
path: spec.ports[0].name | ||
value: https-web | ||
|
||
- it: ExposeTLSDisabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since ExposeTLSDisabled
can be misunderstood as expose.tls.enabled
, maybe change it to InternalTLSDisabled
?
test/unittest/core_tls_test.yaml
Outdated
registry: | ||
enabled: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have registry.enabled
configuration in values.yaml. Remove it?
- Remove duplicated test PodAnnotations - Rename test ArtifactPullAsyncFlushDuration Signed-off-by: Carlos Vega <[email protected]>
a87dadb
to
74326ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
go test
tohelm unittest
helm unittest