-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reorganize unit tests and linting
- Loading branch information
1 parent
30ba8ac
commit d8e260e
Showing
12 changed files
with
322 additions
and
399 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,44 @@ | ||
suite: lint registry values | ||
templates: | ||
- fake.yaml | ||
tests: | ||
- it: nodeSelector is not object | ||
set: | ||
registry: | ||
nodeSelector: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- registry.nodeSelector: Invalid type. Expected: object, given: string | ||
- it: initContainers is not array | ||
set: | ||
registry: | ||
initContainers: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- registry.initContainers: Invalid type. Expected: array, given: string | ||
- it: extraVolumes is not array | ||
set: | ||
registry: | ||
extraVolumes: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- registry.extraVolumes: Invalid type. Expected: array, given: string | ||
- it: extraVolumeMounts is not array | ||
set: | ||
registry: | ||
extraVolumeMounts: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- registry.extraVolumeMounts: Invalid type. Expected: array, given: string |
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,44 @@ | ||
suite: lint sync values | ||
templates: | ||
- fake.yaml | ||
tests: | ||
- it: nodeSelector is not object | ||
set: | ||
sync: | ||
nodeSelector: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- sync.nodeSelector: Invalid type. Expected: object, given: string | ||
- it: initContainers is not array | ||
set: | ||
sync: | ||
initContainers: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- sync.initContainers: Invalid type. Expected: array, given: string | ||
- it: extraVolumes is not array | ||
set: | ||
sync: | ||
extraVolumes: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- sync.extraVolumes: Invalid type. Expected: array, given: string | ||
- it: extraVolumeMounts is not array | ||
set: | ||
sync: | ||
extraVolumeMounts: "qwe" | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: | | ||
values don't meet the specifications of the schema(s) in the following chart(s): | ||
apicurio-registry: | ||
- sync.extraVolumeMounts: Invalid type. Expected: array, given: string |
This file was deleted.
Oops, something went wrong.
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,111 @@ | ||
suite: test deployment-registry.yaml template | ||
templates: | ||
- deployment-registry.yaml | ||
tests: | ||
- it: no selector | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.containers[0].nodeSelector | ||
- it: with node selectors | ||
set: | ||
registry: | ||
nodeSelector: | ||
foo: bar | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.containers[0].nodeSelector.foo | ||
value: bar | ||
- it: no volumes | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.volumes | ||
- it: volumes | ||
set: | ||
registry: | ||
extraVolumes: | ||
- name: baz | ||
emptyDir: {} | ||
- name: foo | ||
secret: | ||
secretName: bar | ||
optional: false | ||
asserts: | ||
- exists: | ||
path: spec.template.spec.volumes | ||
- equal: | ||
path: spec.template.spec.volumes[0].name | ||
value: baz | ||
- equal: | ||
path: spec.template.spec.volumes[0].emptyDir | ||
value: {} | ||
- equal: | ||
path: spec.template.spec.volumes[1].name | ||
value: foo | ||
- equal: | ||
path: spec.template.spec.volumes[1].secret.secretName | ||
value: bar | ||
- equal: | ||
path: spec.template.spec.volumes[1].secret.optional | ||
value: false | ||
- it: no volume mounts | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.containers[0].volumeMounts | ||
- it: volume mounts | ||
set: | ||
registry: | ||
extraVolumeMounts: | ||
- name: foo | ||
mountPath: /bar | ||
readOnly: true | ||
asserts: | ||
- exists: | ||
path: spec.template.spec.containers[0].volumeMounts | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0].name | ||
value: foo | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0].mountPath | ||
value: /bar | ||
- equal: | ||
path: spec.template.spec.containers[0].volumeMounts[0].readOnly | ||
value: true | ||
- it: empty init container | ||
asserts: | ||
- notExists: | ||
path: spec.template.spec.initContainers | ||
- it: dummy init container | ||
set: | ||
registry: | ||
initContainers: | ||
- name: hello-world | ||
image: dummy | ||
command: | ||
- /bin/sh | ||
- -c | ||
- echo "hello world" | ||
volumeMounts: | ||
- name: foo | ||
mountPath: /bar | ||
env: | ||
- name: ENV_VAR | ||
value: VALUE | ||
asserts: | ||
- equal: | ||
path: spec.template.spec.initContainers[0].name | ||
value: hello-world | ||
- equal: | ||
path: spec.template.spec.initContainers[0].command | ||
value: [/bin/sh, -c, echo "hello world"] | ||
- equal: | ||
path: spec.template.spec.initContainers[0].volumeMounts[0].name | ||
value: foo | ||
- equal: | ||
path: spec.template.spec.initContainers[0].volumeMounts[0].mountPath | ||
value: /bar | ||
- equal: | ||
path: spec.template.spec.initContainers[0].env[0].name | ||
value: ENV_VAR | ||
- equal: | ||
path: spec.template.spec.initContainers[0].env[0].value | ||
value: VALUE |
Oops, something went wrong.