test: normalize the titles of the helm unit tests
The contributor guidelines require that the title of a unit test is "a short sentence starting with a capital
letter and ending without a period". Only 30 of the 269 titles followed that rule. The remaining ones were
lowercase verb phrases ("renders a deployment"), which made the test output read inconsistently depending on
which suite was running, and made it impossible to tell a convention violation from an intentional style.
All titles are now imperative, capitalized and unquoted-safe:
renders a deployment -> Render a Deployment
should not render when gatewayAPI.enabled is false -> Skip rendering when gatewayAPI.enabled is false
skips gpg volume spec -> Skip the gpg volume spec
The bracketed prefixes of the dependency checks and of the server section suite are kept, because they group
the tests by the chart they assert on. Only the sentence behind the prefix was rewritten.
Beyond the pure capitalization three classes of titles needed real rewording:
- The titles in image-configuration.yaml named a subject instead of a scenario ("default values", "tag
override", "digest and global registry"). They now describe what is rendered.
- init_directory_structure.sh-rootless.yaml carried "it does not chown /data ...", which rendered as
"it it does not chown" in the test output.
- The "should" prefix in the Gateway API and route suites added no information once the title is a sentence.
The title of the GIT_GC_REPOS test lost its embedded double quotes. The title was previously an unquoted YAML
scalar, so the quotes were literal characters; quoting the title turned them into a parse error. The value is
unambiguous without them.
Three byte-identical tests asserting pgpool.adminPassword existed in customization-integrity-postgresql-ha.yaml
- same template, same assertion, same expected value. They were a copy-paste artifact and shared one title, so
two of them are removed. No coverage is lost, which is why the test count drops from 269 to 267.
No snapshot files are tracked and no suite uses matchSnapshot, so retitling cannot invalidate stored snapshots.
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -14,13 +14,13 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: default values
|
||||
- it: "Render the default image reference"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3-rootless"
|
||||
- it: tag override
|
||||
- it: "Render a custom image tag"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.tag: "1.19.4"
|
||||
@@ -28,7 +28,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.4-rootless"
|
||||
- it: root-based image
|
||||
- it: "Render the root-based image variant"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
@@ -36,7 +36,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3"
|
||||
- it: scoped registry
|
||||
- it: "Render a scoped image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.registry: "example.com"
|
||||
@@ -44,7 +44,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "example.com/gitea:1.19.3-rootless"
|
||||
- it: global registry
|
||||
- it: "Render the global image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
global.imageRegistry: "global.example.com"
|
||||
@@ -52,7 +52,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "global.example.com/gitea:1.19.3-rootless"
|
||||
- it: digest for rootless image
|
||||
- it: "Render a digest for the rootless image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -64,7 +64,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: image fullOverride (does not append rootless)
|
||||
- it: "Render image.fullOverride without appending the rootless suffix"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -81,7 +81,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3"
|
||||
- it: digest for root-based image
|
||||
- it: "Render a digest for the root-based image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -93,7 +93,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: digest and global registry
|
||||
- it: "Render a digest together with the global image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
global.imageRegistry: "global.example.com"
|
||||
@@ -102,7 +102,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "global.example.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: correctly renders floating tag references
|
||||
- it: "Render unquoted floating tag references"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
# use non-quoted values on purpose. See: https://gitea.com/gitea/helm-gitea/issues/631
|
||||
@@ -123,7 +123,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.21-rootless"
|
||||
- it: init containers use their own image configuration
|
||||
- it: "Render the own image configuration of the init containers"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initDirectories.image.registry: "init.example.com"
|
||||
|
||||
Reference in New Issue
Block a user