test: normalize the titles of the helm unit tests
Bash / shellcheck (push) Successful in 8s
Bash / bash-unittest (push) Successful in 24s
changelog / changelog (push) Successful in 16s
Helm / helm-lint (push) Successful in 18s
Helm / helm-unittest (push) Successful in 35s

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:
2026-10-03 21:17:18 +02:00
co-authored by Copilot
parent 7c18b18a47
commit bb3b59f1ee
46 changed files with 250 additions and 264 deletions
+5 -5
View File
@@ -5,14 +5,14 @@ release:
templates:
- templates/secret_admin.yaml
tests:
- it: skips rendering when the admin user is disabled
- it: "Skip rendering when the admin user is disabled"
set:
secrets.admin.enabled: false
asserts:
- hasDocuments:
count: 0
- it: skips rendering using an existing secret reference
- it: "Skip rendering when an existing Secret is referenced"
set:
secrets.admin.enabled: true
secrets.admin.existingSecret.enabled: true
@@ -21,14 +21,14 @@ tests:
- hasDocuments:
count: 0
- it: fails rendering without credentials
- it: "Fail when no credentials are configured"
set:
secrets.admin.new.password: ""
asserts:
- failedTemplate:
errorMessage: Either specify `secrets.admin.new.username` and `secrets.admin.new.password` or reference an existing Secret via `secrets.admin.existingSecret`
- it: renders the secret specification with the default credentials
- it: "Render the Secret with the default credentials"
asserts:
- hasDocuments:
count: 1
@@ -49,7 +49,7 @@ tests:
path: data.username
value: "Z2l0ZWFfYWRtaW4="
- it: supports custom annotations and labels
- it: "Render custom annotations and labels"
set:
secrets.admin.new.annotations:
custom-annotation: annotation-value
+2 -2
View File
@@ -5,14 +5,14 @@ release:
templates:
- templates/secret_inlineConfig.yaml
tests:
- it: "actions are enabled by default (based on vanilla Gitea behavior)"
- it: "Enable actions by default to match vanilla Gitea"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
notExists:
path: data.actions
- it: "actions can be disabled via inline config"
- it: "Disable actions via the inline config"
template: templates/secret_inlineConfig.yaml
set:
gitea.config.actions.ENABLED: false
+3 -3
View File
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "cache is configured correctly for valkey"
- it: "Configure the cache for valkey"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -17,7 +17,7 @@ tests:
ADAPTER=redis
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "cache is configured correctly for 'memory' when valkey is disabled"
- it: "Configure the cache for 'memory' when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -31,7 +31,7 @@ tests:
ADAPTER=memory
HOST=
- it: "cache can be customized when valkey is disabled"
- it: "Customize the cache when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -6,7 +6,7 @@ templates:
- templates/secret_admin.yaml
- templates/secret_config.yaml
tests:
- it: uses `gitea config edit-ini` to write app.ini from environment variables
- it: "Write app.ini from the environment variables via `gitea config edit-ini`"
template: templates/secret_config.yaml
asserts:
- documentIndex: 0
@@ -14,7 +14,7 @@ tests:
path: data["config_environment.sh"]
decodeBase64: true
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
- it: renders data, not stringData, so removed keys are pruned on upgrade
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
template: templates/secret_config.yaml
asserts:
- documentIndex: 0
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: metrics token is set
- it: "Configure the metrics token when it is set"
template: templates/secret_inlineConfig.yaml
set:
gitea:
@@ -18,7 +18,7 @@ tests:
value: |-
ENABLED=true
TOKEN=somepassword
- it: metrics token is empty
- it: "Omit the metrics token when it is empty"
template: templates/secret_inlineConfig.yaml
set:
gitea:
@@ -32,7 +32,7 @@ tests:
decodeBase64: true
value: |-
ENABLED=true
- it: metrics token is nil
- it: "Omit the metrics token when it is nil"
template: templates/secret_inlineConfig.yaml
set:
gitea:
@@ -46,7 +46,7 @@ tests:
decodeBase64: true
value: |-
ENABLED=true
- it: does not configures a token if metrics are disabled
- it: "Omit the metrics token when metrics are disabled"
template: templates/secret_inlineConfig.yaml
set:
gitea:
+3 -3
View File
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "queue is configured correctly for valkey"
- it: "Configure the queue for valkey"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -17,7 +17,7 @@ tests:
CONN_STR=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
TYPE=redis
- it: "queue is configured correctly for 'levelDB' when valkey is disabled"
- it: "Configure the queue for 'levelDB' when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -31,7 +31,7 @@ tests:
CONN_STR=
TYPE=level
- it: "queue can be customized when valkey is disabled"
- it: "Customize the queue when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: "[default values] Use the ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
@@ -24,7 +24,7 @@ tests:
################################################
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: "[no ingress hosts] Use the HTTP Service for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml
set:
ingress:
@@ -48,7 +48,7 @@ tests:
################################################
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: "[provided via values] Use the configured values for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml
set:
gitea.config.server.DOMAIN: provided.example.com
@@ -77,7 +77,7 @@ tests:
################################################
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: "[route enabled] Use the Route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml
set:
route:
@@ -102,7 +102,7 @@ tests:
################################################
- it: "[route tls termination] uses https for ROOT_URL"
- it: "[route tls termination] Use https for ROOT_URL"
template: templates/secret_inlineConfig.yaml
set:
route:
@@ -119,7 +119,7 @@ tests:
################################################
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: "[HTTPRoute enabled] Use the first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
template: templates/secret_inlineConfig.yaml
set:
ingress:
@@ -152,7 +152,7 @@ tests:
################################################
- it: "[HTTPRoute tls] switches ROOT_URL to https"
- it: "[HTTPRoute tls] Switch ROOT_URL to https"
template: templates/secret_inlineConfig.yaml
set:
ingress:
+3 -3
View File
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "session is configured correctly for valkey"
- it: "Configure the session for valkey"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -17,7 +17,7 @@ tests:
PROVIDER=redis
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "session is configured correctly for 'memory' when valkey is disabled"
- it: "Configure the session for 'memory' when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -31,7 +31,7 @@ tests:
PROVIDER=memory
PROVIDER_CONFIG=
- it: "session can be customized when valkey is disabled"
- it: "Customize the session when valkey is disabled"
template: templates/secret_inlineConfig.yaml
set:
valkey:
@@ -25,7 +25,7 @@ set:
persistence:
size: 1337Mi
tests:
- it: "[postgresql-ha] DB settings are applied as expected"
- it: "[postgresql-ha] Apply the database settings"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
asserts:
- documentIndex: 0
@@ -40,7 +40,7 @@ tests:
content:
name: POSTGRES_USER
value: "gitea-username"
- it: "[postgresql-ha] DB passwords are applied as expected"
- it: "[postgresql-ha] Apply the database passwords"
template: charts/postgresql-ha/templates/postgresql/secrets.yaml
asserts:
- documentIndex: 0
@@ -55,49 +55,35 @@ tests:
equal:
path: data["password"]
value: "Z2l0ZWEtcGFzc3dvcmQ=" # postgresql-ha.postgresql.password is overwritten by postgresql-ha.global.postgresql.password and should not be referenced here
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
- it: "[postgresql-ha] Apply pgpool.adminPassword"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["admin-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
- it: "[postgresql-ha] pgpool.srCheckPassword is applied as expected"
- it: "[postgresql-ha] Apply pgpool.srCheckPassword"
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["sr-check-password"]
value: "Y3VzdG9tLXBhc3N3b3JkLXNyLWNoZWNr"
- it: "[postgresql-ha] persistence.size is applied as expected"
- it: "[postgresql-ha] Apply persistence.size"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
asserts:
- documentIndex: 0
equal:
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
value: "1337Mi"
- it: "[postgresql-ha] service.ports.postgresql is applied as expected"
- it: "[postgresql-ha] Apply service.ports.postgresql"
template: charts/postgresql-ha/templates/pgpool/service.yaml
asserts:
- documentIndex: 0
equal:
path: spec.ports[0].port
value: 1234
- it: "[postgresql-ha] renders the referenced service"
- it: "[postgresql-ha] Render the referenced Service"
template: charts/postgresql-ha/templates/pgpool/service.yaml
asserts:
- containsDocument:
@@ -105,7 +91,7 @@ tests:
apiVersion: v1
name: gitea-unittests-postgresql-ha-pgpool
namespace: testing
- it: "[gitea] connects to pgpool service"
- it: "[gitea] Connect to the pgpool Service"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
@@ -113,7 +99,7 @@ tests:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234
- it: "[gitea] connects to pgpool service with custom cluster domain"
- it: "[gitea] Connect to the pgpool Service with a custom cluster domain"
set:
clusterDomain: my-special-cluster.local
template: templates/secret_inlineConfig.yaml
@@ -123,7 +109,7 @@ tests:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
- it: "[gitea] connects to configured database"
- it: "[gitea] Connect to the configured database"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
@@ -20,7 +20,7 @@ set:
persistence:
size: 1337Mi
tests:
- it: "[postgresql] DB settings are applied as expected"
- it: "[postgresql] Apply the database settings"
template: charts/postgresql/templates/primary/statefulset.yaml
asserts:
- documentIndex: 0
@@ -35,28 +35,28 @@ tests:
content:
name: POSTGRES_USER
value: "gitea-username"
- it: "[postgresql] DB password is applied as expected"
- it: "[postgresql] Apply the database password"
template: charts/postgresql/templates/secrets.yaml
asserts:
- documentIndex: 0
equal:
path: data["password"]
value: "Z2l0ZWEtcGFzc3dvcmQ="
- it: "[postgresql] primary.persistence.size is applied as expected"
- it: "[postgresql] Apply primary.persistence.size"
template: charts/postgresql/templates/primary/statefulset.yaml
asserts:
- documentIndex: 0
equal:
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
value: "1337Mi"
- it: "[postgresql] global.postgresql.service.ports.postgresql is applied as expected"
- it: "[postgresql] Apply global.postgresql.service.ports.postgresql"
template: charts/postgresql/templates/primary/svc.yaml
asserts:
- documentIndex: 0
equal:
path: spec.ports[0].port
value: 1234
- it: "[postgresql] renders the referenced service"
- it: "[postgresql] Render the referenced Service"
template: charts/postgresql/templates/primary/svc.yaml
asserts:
- containsDocument:
@@ -64,7 +64,7 @@ tests:
apiVersion: v1
name: gitea-unittests-postgresql
namespace: testing
- it: "[gitea] connects to postgresql service"
- it: "[gitea] Connect to the postgresql Service"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
@@ -72,7 +72,7 @@ tests:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
- it: "[gitea] connects to postgresql service with custom cluster domain"
- it: "[gitea] Connect to the postgresql Service with a custom cluster domain"
set:
clusterDomain: my-special-cluster.local
template: templates/secret_inlineConfig.yaml
@@ -82,7 +82,7 @@ tests:
path: data.database
decodeBase64: true
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
- it: "[gitea] connects to configured database"
- it: "[gitea] Connect to the configured database"
template: templates/secret_inlineConfig.yaml
asserts:
- documentIndex: 0
@@ -12,14 +12,14 @@ set:
permissions: "~* &* +@all"
password: gitea-password
tests:
- it: "[valkey] valkey.auth.aclUsers.default.password is applied as expected"
- it: "[valkey] Apply valkey.auth.aclUsers.default.password"
template: charts/valkey/templates/secret.yaml
asserts:
- documentIndex: 0
equal:
path: data.default-password
value: "Z2l0ZWEtcGFzc3dvcmQ="
- it: "[valkey] renders the referenced service"
- it: "[valkey] Render the referenced Service"
template: charts/valkey/templates/service.yaml
asserts:
- containsDocument:
@@ -34,7 +34,7 @@ tests:
port: 6379
targetPort: tcp
protocol: TCP
- it: "[gitea] waits for valkey to be up and running"
- it: "[gitea] Wait for valkey to be up and running"
template: templates/secret_init.yaml
asserts:
- documentIndex: 0
@@ -42,7 +42,7 @@ tests:
path: data["configure_gitea.sh"]
decodeBase64: true
pattern: nc -vz -w2 gitea-unittests-valkey.testing.svc.cluster.local 6379
- it: "[gitea] waits for valkey to be up and running with custom cluster domain"
- it: "[gitea] Wait for valkey to be up and running with a custom cluster domain"
set:
clusterDomain: my-special-cluster.local
template: templates/secret_init.yaml
@@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "[postgresql-ha] ensures we detect major image version upgrades"
- it: "[postgresql-ha] Detect major image version upgrades"
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
set:
postgresql:
@@ -16,7 +16,7 @@ tests:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: bitnamilegacy/postgresql-repmgr:17.+$
- it: "[postgresql] ensures we detect major image version upgrades"
- it: "[postgresql] Detect major image version upgrades"
template: charts/postgresql/templates/primary/statefulset.yaml
set:
postgresql:
@@ -29,7 +29,7 @@ tests:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: bitnamilegacy/postgresql:17.+$
- it: "[valkey] ensures we detect major image version upgrades"
- it: "[valkey] Detect major image version upgrades"
template: charts/valkey/templates/deploy_valkey.yaml
set:
valkey:
+4 -4
View File
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
- it: "Fail with multiple replicas and GIT_GC_REPOS enabled"
template: templates/secret_config.yaml
set:
deployment:
@@ -28,7 +28,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
- it: fails with multiple replicas and RWX file system not set
- it: "Fail with multiple replicas and no RWX file system"
template: templates/secret_config.yaml
set:
deployment:
@@ -36,7 +36,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.new.accessModes[0] must be set to ReadWriteMany."
- it: fails with multiple replicas and bleve issue indexer
- it: "Fail with multiple replicas and the bleve issue indexer"
template: templates/secret_config.yaml
set:
deployment:
@@ -52,7 +52,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
- it: fails with multiple replicas and bleve repo indexer
- it: "Fail with multiple replicas and the bleve repo indexer"
template: templates/secret_config.yaml
set:
deployment:
+4 -4
View File
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: reads the admin credentials from the generated secret
- it: "Read the admin credentials from the generated Secret"
template: templates/deployment.yaml
asserts:
- contains:
@@ -44,7 +44,7 @@ tests:
name: GITEA_ADMIN_PASSWORD_MODE
value: keepUpdated
- it: reads the admin credentials from the configured keys of an existing secret
- it: "Read the admin credentials from the configured keys of an existing Secret"
template: templates/deployment.yaml
set:
secrets.admin.existingSecret.enabled: true
@@ -78,7 +78,7 @@ tests:
key: custom-email
name: custom-admin-secret
- it: omits the admin environment when the admin user is disabled
- it: "Omit the admin environment when the admin user is disabled"
template: templates/deployment.yaml
set:
secrets.admin.enabled: false
@@ -94,7 +94,7 @@ tests:
name: GITEA_ADMIN_PASSWORD_MODE
any: true
- it: fails on an unsupported password mode
- it: "Fail on an unsupported password mode"
template: templates/deployment.yaml
set:
secrets.admin.passwordMode: unsupported
+32 -32
View File
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: renders a deployment
- it: "Render a Deployment"
template: templates/deployment.yaml
asserts:
- hasDocuments:
@@ -20,14 +20,14 @@ tests:
kind: Deployment
apiVersion: apps/v1
name: gitea-unittests
- it: renders no deployment when disabled
- it: "Skip rendering when the Deployment is disabled"
template: templates/deployment.yaml
set:
deployment.enabled: false
asserts:
- hasDocuments:
count: 0
- it: deployment labels are set
- it: "Render the configured Deployment labels"
template: templates/deployment.yaml
set:
deployment.labels:
@@ -45,7 +45,7 @@ tests:
path: spec.selector.matchLabels
content:
hello: world
- it: deployment labels are not in selector matchLabels
- it: "Omit the Deployment labels from the selector matchLabels"
template: templates/deployment.yaml
set:
deployment.labels:
@@ -57,7 +57,7 @@ tests:
value:
app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea-unittests
- it: deployment labels are always rendered
- it: "Render the Deployment labels even when none are configured"
template: templates/deployment.yaml
asserts:
- isSubset:
@@ -67,12 +67,12 @@ tests:
app.kubernetes.io/name: gitea
app.kubernetes.io/instance: gitea-unittests
app.kubernetes.io/managed-by: Helm
- it: deployment annotations are undefined
- it: "Omit the Deployment annotations when none are configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: metadata.annotations
- it: deployment annotations are set
- it: "Render the configured Deployment annotations"
template: templates/deployment.yaml
set:
deployment.annotations:
@@ -82,12 +82,12 @@ tests:
path: metadata.annotations
value:
hello: world
- it: nodeSelector is undefined
- it: "Omit the nodeSelector when none is configured"
asserts:
- notExists:
path: spec.template.spec.nodeSelector
template: templates/deployment.yaml
- it: nodeSelector is defined
- it: "Render the configured nodeSelector"
set:
deployment.nodeSelector:
foo: bar
@@ -99,12 +99,12 @@ tests:
foo: bar
bar: foo
template: templates/deployment.yaml
- it: affinity is undefined
- it: "Omit the affinity when none is configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.affinity
- it: affinity is defined
- it: "Render the configured affinity"
template: templates/deployment.yaml
set:
deployment.affinity:
@@ -128,12 +128,12 @@ tests:
operator: In
values:
- linux
- it: dnsConfig is undefined
- it: "Omit the dnsConfig when none is configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.dnsConfig
- it: dnsConfig is defined
- it: "Render the configured dnsConfig"
template: templates/deployment.yaml
set:
deployment.dnsConfig:
@@ -151,12 +151,12 @@ tests:
options:
- name: ndots
value: "2"
- it: priorityClassName is undefined
- it: "Omit the priorityClassName when none is configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.priorityClassName
- it: priorityClassName is defined
- it: "Render the configured priorityClassName"
template: templates/deployment.yaml
set:
deployment.priorityClassName: high-priority
@@ -164,12 +164,12 @@ tests:
- equal:
path: spec.template.spec.priorityClassName
value: high-priority
- it: schedulerName is undefined
- it: "Omit the schedulerName when none is configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.schedulerName
- it: schedulerName is defined
- it: "Render the configured schedulerName"
template: templates/deployment.yaml
set:
deployment.schedulerName: stork
@@ -177,7 +177,7 @@ tests:
- equal:
path: spec.template.spec.schedulerName
value: stork
- it: strategy defaults to a rolling update
- it: "Default the strategy to a rolling update"
template: templates/deployment.yaml
asserts:
- equal:
@@ -187,7 +187,7 @@ tests:
rollingUpdate:
maxUnavailable: 0
maxSurge: 100%
- it: strategy omits rollingUpdate for other strategy types
- it: "Omit rollingUpdate for other strategy types"
template: templates/deployment.yaml
set:
deployment.strategy.type: Recreate
@@ -196,12 +196,12 @@ tests:
path: spec.strategy
value:
type: Recreate
- it: tolerations are undefined
- it: "Omit the tolerations when none are configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.tolerations
- it: tolerations are defined
- it: "Render the configured tolerations"
template: templates/deployment.yaml
set:
deployment.tolerations:
@@ -217,12 +217,12 @@ tests:
operator: Equal
value: postgres
effect: NoSchedule
- it: topologySpreadConstraints are undefined
- it: "Omit the topologySpreadConstraints when none are configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.topologySpreadConstraints
- it: topologySpreadConstraints are defined
- it: "Render the configured topologySpreadConstraints"
template: templates/deployment.yaml
set:
deployment.topologySpreadConstraints:
@@ -243,7 +243,7 @@ tests:
matchLabels:
app.kubernetes.io/instance: gitea-unittests
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container"
- it: "Inject TMP_EXISTING_ENVS_FILE into the 'init-app-ini' init container"
template: templates/deployment.yaml
asserts:
- contains:
@@ -251,7 +251,7 @@ tests:
content:
name: TMP_EXISTING_ENVS_FILE
value: /tmp/existing-envs
- it: "injects ENV_TO_INI_MOUNT_POINT as environment variable to 'init-app-ini' init container"
- it: "Inject ENV_TO_INI_MOUNT_POINT into the 'init-app-ini' init container"
template: templates/deployment.yaml
asserts:
- contains:
@@ -259,7 +259,7 @@ tests:
content:
name: ENV_TO_INI_MOUNT_POINT
value: /env-to-ini-mounts
- it: "deployment.gitea.env is injected into all init containers and the gitea container"
- it: "Inject deployment.gitea.env into all init containers and the gitea container"
template: templates/deployment.yaml
set:
deployment.gitea.env:
@@ -286,7 +286,7 @@ tests:
content:
name: VARIABLE
value: my-value
- it: CPU resources are defined as well as GOMAXPROCS
- it: "Render GOMAXPROCS when the CPU resources are defined"
template: templates/deployment.yaml
set:
deployment.gitea.resources:
@@ -314,7 +314,7 @@ tests:
requests:
cpu: 100ms
memory: 100Mi
- it: container resources default to an empty map and GOMAXPROCS is omitted
- it: "Default the container resources to an empty map and omit GOMAXPROCS"
template: templates/deployment.yaml
asserts:
- equal:
@@ -328,12 +328,12 @@ tests:
resourceFieldRef:
divisor: "1"
resource: limits.cpu
- it: pod level resources are undefined
- it: "Omit the pod level resources when none are configured"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.resources
- it: pod level resources are defined
- it: "Render the configured pod level resources"
template: templates/deployment.yaml
set:
deployment.resources:
@@ -353,7 +353,7 @@ tests:
requests:
cpu: 250m
memory: 256Mi
- it: Init containers have correct volumeMount path
- it: "Render the configured volumeMount path of the init containers"
template: templates/deployment.yaml
set:
initContainersScriptsVolumeMountPath: "/custom/init/path"
@@ -364,7 +364,7 @@ tests:
- equal:
path: spec.template.spec.initContainers[*].volumeMounts[?(@.name=="config")].mountPath
value: "/custom/init/path"
- it: Init containers have correct volumeMount path if there is no override
- it: "Render the default volumeMount path of the init containers"
template: templates/deployment.yaml
asserts:
- equal:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: omits the checksum annotations by default
- it: "Omit the checksum annotations by default"
template: templates/deployment.yaml
set:
secrets.admin.enabled: true
@@ -37,7 +37,7 @@ tests:
- notExists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds a checksum annotation for every Secret when addSHASumAnnotation is enabled
- it: "Add a checksum annotation for every Secret when addSHASumAnnotation is enabled"
template: templates/deployment.yaml
set:
secrets.admin.addSHASumAnnotation: true
@@ -74,7 +74,7 @@ tests:
- exists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: omits the checksum annotation of a single disabled Secret only
- it: "Omit the checksum annotation of a single disabled Secret only"
template: templates/deployment.yaml
set:
secrets.admin.addSHASumAnnotation: false
@@ -111,7 +111,7 @@ tests:
- notExists:
path: spec.template.metadata.annotations["checksum/metrics"]
- it: adds the checksum of Secrets provided by the user
- it: "Add the checksum of Secrets provided by the user"
template: templates/deployment.yaml
set:
secrets.admin.enabled: true
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: Renders a deployment
- it: "Render a Deployment with additionalConfigFromEnvs"
template: templates/deployment.yaml
asserts:
- hasDocuments:
@@ -20,7 +20,7 @@ tests:
kind: Deployment
apiVersion: apps/v1
name: gitea-unittests
- it: Deployment with empty additionalConfigFromEnvs
- it: "Render the Deployment with empty additionalConfigFromEnvs"
template: templates/deployment.yaml
set:
gitea.additionalConfigFromEnvs: []
@@ -48,7 +48,7 @@ tests:
value: /tmp/existing-envs
- name: ENV_TO_INI_MOUNT_POINT
value: /env-to-ini-mounts
- it: Deployment with standard additionalConfigFromEnvs
- it: "Render the Deployment with standard additionalConfigFromEnvs"
template: templates/deployment.yaml
set:
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: my-db:123}, {name: GITEA_database_USER, value: my-user}]
@@ -80,7 +80,7 @@ tests:
value: my-db:123
- name: GITEA_database_USER
value: my-user
- it: Deployment with templated additionalConfigFromEnvs
- it: "Render the Deployment with templated additionalConfigFromEnvs"
template: templates/deployment.yaml
set:
gitea.misc.host: my-db-host:321
@@ -114,7 +114,7 @@ tests:
value: my-db-host:321
- name: GITEA_database_USER
value: my-db-user
- it: Deployment with additionalConfigFromEnvs templated secret name
- it: "Render the Deployment with a templated Secret name in additionalConfigFromEnvs"
template: templates/deployment.yaml
set:
gitea.misc.existingSecret: my-db-secret
+25 -25
View File
@@ -5,11 +5,11 @@ release:
templates:
- templates/deprecation.yaml
tests:
- it: renders nothing with the default values
- it: "Render nothing with the default values"
asserts:
- hasDocuments:
count: 0
- it: fails when the removed `affinity` value is set
- it: "Fail when the removed `affinity` value is set"
set:
affinity:
nodeAffinity:
@@ -23,14 +23,14 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`affinity` does no longer exist. Please refer to the changelog and configure `deployment.affinity` instead."
- it: fails when the removed `containerSecurityContext` value is set
- it: "Fail when the removed `containerSecurityContext` value is set"
set:
containerSecurityContext:
runAsUser: 1000
asserts:
- failedTemplate:
errorMessage: "`containerSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.gitea.securityContext` instead."
- it: fails when the removed `deployment.env` value is set
- it: "Fail when the removed `deployment.env` value is set"
set:
deployment.env:
- name: VARIABLE
@@ -38,7 +38,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead."
- it: fails when the removed `dnsConfig` value is set
- it: "Fail when the removed `dnsConfig` value is set"
set:
dnsConfig:
nameservers:
@@ -46,7 +46,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead."
- it: fails when the removed `extraContainerVolumeMounts` value is set
- it: "Fail when the removed `extraContainerVolumeMounts` value is set"
set:
extraContainerVolumeMounts:
- name: postgres-ssl-vol
@@ -54,7 +54,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead."
- it: fails when the removed `extraInitVolumeMounts` value is set
- it: "Fail when the removed `extraInitVolumeMounts` value is set"
set:
extraInitVolumeMounts:
- name: postgres-ssl-vol
@@ -62,7 +62,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead."
- it: fails when the removed `extraVolumeMounts` value is set
- it: "Fail when the removed `extraVolumeMounts` value is set"
set:
extraVolumeMounts:
- name: postgres-ssl-vol
@@ -70,7 +70,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead."
- it: fails when the removed `extraVolumes` value is set
- it: "Fail when the removed `extraVolumes` value is set"
set:
extraVolumes:
- name: postgres-ssl-vol
@@ -79,39 +79,39 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead."
- it: fails when the removed `ingress.className` value is set
- it: "Fail when the removed `ingress.className` value is set"
set:
ingress.className: ""
asserts:
- failedTemplate:
errorMessage: "`ingress.className` does no longer exist. Please refer to the changelog and configure `ingress.ingressClassName` instead."
- it: fails when the removed `nodeSelector` value is set
- it: "Fail when the removed `nodeSelector` value is set"
set:
nodeSelector:
foo: bar
asserts:
- failedTemplate:
errorMessage: "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead."
- it: fails when the removed `openshift.hostUsers` value is set
- it: "Fail when the removed `openshift.hostUsers` value is set"
set:
openshift.hostUsers: false
asserts:
- failedTemplate:
errorMessage: "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead."
- it: fails when the removed `priorityClassName` value is set
- it: "Fail when the removed `priorityClassName` value is set"
set:
priorityClassName: high-priority
asserts:
- failedTemplate:
errorMessage: "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead."
- it: fails when the removed `podSecurityContext` value is set
- it: "Fail when the removed `podSecurityContext` value is set"
set:
podSecurityContext:
fsGroup: 1000
asserts:
- failedTemplate:
errorMessage: "`podSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` instead."
- it: fails when the removed `postExtraInitContainers` value is set
- it: "Fail when the removed `postExtraInitContainers` value is set"
set:
postExtraInitContainers:
- name: post-init-container
@@ -119,7 +119,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`postExtraInitContainers` does no longer exist. Please refer to the changelog and append an entry with a `container` key to `deployment.initContainers` instead."
- it: fails when the removed `preExtraInitContainers` value is set
- it: "Fail when the removed `preExtraInitContainers` value is set"
set:
preExtraInitContainers:
- name: pre-init-container
@@ -127,7 +127,7 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`preExtraInitContainers` does no longer exist. Please refer to the changelog and prepend an entry with a `container` key to `deployment.initContainers` instead."
- it: fails when the removed `resources` value is set
- it: "Fail when the removed `resources` value is set"
set:
resources:
limits:
@@ -135,40 +135,40 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
- it: fails when the removed `replicaCount` value is set
- it: "Fail when the removed `replicaCount` value is set"
set:
replicaCount: 2
asserts:
- failedTemplate:
errorMessage: "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead."
- it: fails when the removed `schedulerName` value is set
- it: "Fail when the removed `schedulerName` value is set"
set:
schedulerName: stork
asserts:
- failedTemplate:
errorMessage: "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead."
- it: fails when the removed `securityContext` value is set
- it: "Fail when the removed `securityContext` value is set"
set:
securityContext:
runAsUser: 1000
asserts:
- failedTemplate:
errorMessage: "`securityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` and `deployment.gitea.securityContext` instead."
- it: fails when the removed `strategy` value is set
- it: "Fail when the removed `strategy` value is set"
set:
strategy:
type: Recreate
asserts:
- failedTemplate:
errorMessage: "`strategy` does no longer exist. Please refer to the changelog and configure `deployment.strategy` instead."
- it: fails when the removed `test` value is set
- it: "Fail when the removed `test` value is set"
set:
test:
enabled: false
asserts:
- failedTemplate:
errorMessage: "`test` does no longer exist. Please refer to the changelog. The `helm test` connection Pod has been removed without replacement."
- it: fails when the removed `tolerations` value is set
- it: "Fail when the removed `tolerations` value is set"
set:
tolerations:
- key: database/type
@@ -178,14 +178,14 @@ tests:
asserts:
- failedTemplate:
errorMessage: "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead."
- it: fails when the removed `topologySpreadConstraints` value is set
- it: "Fail when the removed `topologySpreadConstraints` value is set"
set:
topologySpreadConstraints:
- topologyKey: kubernetes.io/hostname
asserts:
- failedTemplate:
errorMessage: "`topologySpreadConstraints` does no longer exist. Please refer to the changelog and configure `deployment.topologySpreadConstraints` instead."
- it: skips the deprecation checks when `checkDeprecation` is disabled
- it: "Skip the deprecation checks when `checkDeprecation` is disabled"
set:
checkDeprecation: false
affinity:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: uses direct execution when extraEnvSourceFile is not set
- it: "Use direct execution when extraEnvSourceFile is not set"
template: templates/deployment.yaml
asserts:
- equal:
@@ -25,7 +25,7 @@ tests:
- notExists:
path: spec.template.spec.initContainers[2].args
- it: sources env file in init-app-ini when extraEnvSourceFile is set
- it: "Source the env file in init-app-ini when extraEnvSourceFile is set"
template: templates/deployment.yaml
set:
gitea:
@@ -41,7 +41,7 @@ tests:
path: spec.template.spec.initContainers[1].args[0]
pattern: config_environment\.sh
- it: sources env file in configure-gitea when extraEnvSourceFile is set
- it: "Source the env file in configure-gitea when extraEnvSourceFile is set"
template: templates/deployment.yaml
set:
gitea:
@@ -57,7 +57,7 @@ tests:
path: spec.template.spec.initContainers[2].args[0]
pattern: configure_gitea\.sh
- it: sources env file in configure-gpg when extraEnvSourceFile is set with signing enabled
- it: "Source the env file in configure-gpg when extraEnvSourceFile is set and signing is enabled"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -76,7 +76,7 @@ tests:
path: spec.template.spec.initContainers[2].args[0]
pattern: configure_gpg_environment\.sh
- it: includes file existence check in source command
- it: "Include a file existence check in the source command"
template: templates/deployment.yaml
set:
gitea:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: Render the deployment (default)
- it: "Render the Deployment with the default init containers"
asserts:
- hasDocuments:
count: 1
@@ -21,7 +21,7 @@ tests:
count: 3
template: templates/deployment.yaml
- it: Render the deployment (signing)
- it: "Render the Deployment with the signing init container"
set:
secrets.gpg.enabled: true
secrets.gpg.existingSecret.enabled: true
@@ -35,7 +35,7 @@ tests:
count: 4
template: templates/deployment.yaml
- it: Render the deployment (extraInitContainers)
- it: "Render the Deployment with extraInitContainers"
set:
deployment.initContainers:
- container:
@@ -68,7 +68,7 @@ tests:
value: foo
template: templates/deployment.yaml
- it: renders the chart-managed init containers in the configured order
- it: "Render the chart-managed init containers in the configured order"
template: templates/deployment.yaml
set:
deployment.initContainers:
@@ -82,7 +82,7 @@ tests:
path: spec.template.spec.initContainers[1].name
value: init-directories
- it: fails when an init container entry sets both container and link
- it: "Fail when an init container entry sets both container and link"
template: templates/deployment.yaml
set:
deployment.initContainers:
@@ -94,7 +94,7 @@ tests:
- failedTemplate:
errorMessage: "deployment.initContainers[0]: `container` and `link` are mutually exclusive"
- it: fails when an init container entry sets neither container nor link
- it: "Fail when an init container entry sets neither container nor link"
template: templates/deployment.yaml
set:
deployment.initContainers:
@@ -103,7 +103,7 @@ tests:
- failedTemplate:
errorMessage: "deployment.initContainers[0]: either `container` or `link` must be set"
- it: fails when an init container links to an unknown configuration
- it: "Fail when an init container links to an unknown configuration"
template: templates/deployment.yaml
set:
deployment.initContainers:
@@ -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"
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: appends the per-container env
- it: "Append the per-container env"
template: templates/deployment.yaml
set:
deployment.initDirectories.env:
@@ -37,7 +37,7 @@ tests:
name: INIT_DIRECTORIES
value: "1"
- it: renders the per-container envFrom
- it: "Render the per-container envFrom"
template: templates/deployment.yaml
set:
deployment.initAppIni.envFrom:
@@ -52,7 +52,7 @@ tests:
- secretRef:
name: special-secret
- it: appends the per-container volumeMounts
- it: "Append the per-container volumeMounts"
template: templates/deployment.yaml
set:
deployment.initConfigureGitea.volumeMounts:
@@ -73,7 +73,7 @@ tests:
mountPath: /configmap
readOnly: true
- it: overrides the resources of a single init container
- it: "Override the resources of a single init container"
template: templates/deployment.yaml
set:
deployment.initDirectories.resources:
@@ -93,7 +93,7 @@ tests:
cpu: 100m
memory: 128Mi
- it: overrides the security context of a single init container
- it: "Override the security context of a single init container"
template: templates/deployment.yaml
set:
deployment.gitea.securityContext:
@@ -108,7 +108,7 @@ tests:
path: spec.template.spec.initContainers[1].securityContext.runAsUser
value: 1000
- it: renders the envFrom of the gitea container
- it: "Render the envFrom of the gitea container"
template: templates/deployment.yaml
set:
deployment.gitea.envFrom:
@@ -121,7 +121,7 @@ tests:
- configMapRef:
name: special-config
- it: omits envFrom when unset
- it: "Omit the envFrom when it is unset"
template: templates/deployment.yaml
asserts:
- notExists:
+2 -2
View File
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_inlineConfig.yaml
tests:
- it: inline config data.server using TPL
- it: "Render the inline config of data.server via tpl"
set:
global.giteaHostName: "gitea.example.com"
ingress.enabled: true
@@ -34,7 +34,7 @@ tests:
path: data.server
decodeBase64: true
pattern: SSH_DOMAIN=gitea\.example\.com
- it: renders data, not stringData, so removed sections are pruned on upgrade
- it: "Render data instead of stringData so removed sections are pruned on upgrade"
asserts:
- documentIndex: 0
notExists:
+4 -4
View File
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: renders openshift-compatible defaults for chart-managed containers
- it: "Render OpenShift compatible defaults for the chart-managed containers"
template: templates/deployment.yaml
set:
openshift.enabled: true
@@ -61,7 +61,7 @@ tests:
seccompProfile:
type: RuntimeDefault
- it: does not force runAsUser 1000 for command init containers on OpenShift
- it: "Omit runAsUser 1000 for command init containers on OpenShift"
template: templates/deployment.yaml
set:
openshift.enabled: true
@@ -74,7 +74,7 @@ tests:
- notExists:
path: spec.template.spec.initContainers[3].securityContext.runAsUser
- it: preserves explicit pod and container security context overrides on OpenShift
- it: "Preserve explicit pod and container security context overrides on OpenShift"
template: templates/deployment.yaml
set:
openshift:
@@ -102,7 +102,7 @@ tests:
path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000620000
- it: renders an explicit hostUsers=false override on OpenShift
- it: "Render an explicit hostUsers=false override on OpenShift"
template: templates/deployment.yaml
set:
openshift:
+10 -10
View File
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: renders default liveness probe
- it: "Render the default liveness probe"
template: templates/deployment.yaml
asserts:
- notExists:
@@ -26,7 +26,7 @@ tests:
tcpSocket:
port: http
timeoutSeconds: 1
- it: renders default readiness probe
- it: "Render the default readiness probe"
template: templates/deployment.yaml
asserts:
- notExists:
@@ -41,12 +41,12 @@ tests:
tcpSocket:
port: http
timeoutSeconds: 1
- it: does not render a default startup probe
- it: "Skip the startup probe by default"
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.containers[0].startupProbe
- it: allows enabling a startup probe
- it: "Render the startup probe when it is enabled"
template: templates/deployment.yaml
set:
gitea.startupProbe.enabled: true
@@ -64,7 +64,7 @@ tests:
port: http
timeoutSeconds: 1
- it: allows overwriting the default port of the liveness probe
- it: "Overwrite the default port of the liveness probe"
template: templates/deployment.yaml
set:
gitea:
@@ -78,7 +78,7 @@ tests:
tcpSocket:
port: my-port
- it: allows overwriting the default port of the readiness probe
- it: "Overwrite the default port of the readiness probe"
template: templates/deployment.yaml
set:
gitea:
@@ -92,7 +92,7 @@ tests:
tcpSocket:
port: my-port
- it: allows overwriting the default port of the startup probe
- it: "Overwrite the default port of the startup probe"
template: templates/deployment.yaml
set:
gitea:
@@ -107,7 +107,7 @@ tests:
tcpSocket:
port: my-port
- it: allows using a non-default method as liveness probe
- it: "Use a non-default method as liveness probe"
template: templates/deployment.yaml
set:
gitea:
@@ -135,7 +135,7 @@ tests:
port: http
timeoutSeconds: 13372
- it: allows using a non-default method as readiness probe
- it: "Use a non-default method as readiness probe"
template: templates/deployment.yaml
set:
gitea:
@@ -163,7 +163,7 @@ tests:
port: http
timeoutSeconds: 13372
- it: allows using a non-default method as startup probe
- it: "Use a non-default method as startup probe"
template: templates/deployment.yaml
set:
gitea:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: supports adding a sidecar container
- it: "Render an additional sidecar container"
template: templates/deployment.yaml
set:
extraContainers:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: skips gpg init container
- it: "Skip the gpg init container"
template: templates/deployment.yaml
asserts:
- notContains:
@@ -19,7 +19,7 @@ tests:
any: true
content:
name: configure-gpg
- it: skips gpg env in `init-directories` init container
- it: "Skip the gpg env of the `init-directories` init container"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: false
@@ -28,14 +28,14 @@ tests:
path: spec.template.spec.initContainers[0].env
content:
name: GNUPGHOME
- it: skips gpg env in runtime container
- it: "Skip the gpg env of the runtime container"
template: templates/deployment.yaml
asserts:
- notContains:
path: spec.template.spec.containers[0].env
content:
name: GNUPGHOME
- it: skips gpg volume spec
- it: "Skip the gpg volume spec"
template: templates/deployment.yaml
asserts:
- notContains:
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: adds gpg init container
- it: "Add the gpg init container"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -48,7 +48,7 @@ tests:
- name: gpg-private-key
mountPath: /raw
readOnly: true
- it: adds gpg env in `init-directories` init container
- it: "Add the gpg env to the `init-directories` init container"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -63,7 +63,7 @@ tests:
secretKeyRef:
name: custom-gpg-secret
key: gpgHome
- it: adds gpg env in runtime container
- it: "Add the gpg env to the runtime container"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -78,7 +78,7 @@ tests:
secretKeyRef:
name: custom-gpg-secret
key: gpgHome
- it: reads the gpg home from the configured key of an existing secret
- it: "Read the gpg home from the configured key of an existing Secret"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -94,7 +94,7 @@ tests:
secretKeyRef:
name: custom-gpg-secret
key: custom-gpg-home
- it: adds gpg volume spec
- it: "Add the gpg volume spec"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -110,7 +110,7 @@ tests:
- key: privateKey
path: private.asc
defaultMode: 0100
- it: supports gpg volume spec with external reference
- it: "Render the gpg volume spec with an external reference"
template: templates/deployment.yaml
set:
secrets.gpg.enabled: true
@@ -11,7 +11,7 @@ templates:
- templates/secret_inlineConfig.yaml
- templates/secret_metrics.yaml
tests:
- it: supports defining SSH log level for root based image
- it: "Define the SSH log level for the root based image"
template: templates/deployment.yaml
set:
deployment.gitea.image.rootless: false
@@ -21,7 +21,7 @@ tests:
content:
name: SSH_LOG_LEVEL
value: "INFO"
- it: supports overriding SSH log level
- it: "Override the SSH log level"
template: templates/deployment.yaml
set:
deployment.gitea.image.rootless: false
@@ -32,7 +32,7 @@ tests:
content:
name: SSH_LOG_LEVEL
value: "DEBUG"
- it: supports overriding SSH log level (even when image.fullOverride set)
- it: "Override the SSH log level when image.fullOverride is set"
template: templates/deployment.yaml
set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
@@ -44,7 +44,7 @@ tests:
content:
name: SSH_LOG_LEVEL
value: "DEBUG"
- it: skips SSH_LOG_LEVEL for rootless image
- it: "Skip SSH_LOG_LEVEL for the rootless image"
template: templates/deployment.yaml
set:
deployment.gitea.image.rootless: true
@@ -55,7 +55,7 @@ tests:
any: true
content:
name: SSH_LOG_LEVEL
- it: skips SSH_LOG_LEVEL for rootless image (even when image.fullOverride set)
- it: "Skip SSH_LOG_LEVEL for the rootless image when image.fullOverride is set"
template: templates/deployment.yaml
set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
@@ -7,7 +7,7 @@ suite: Storage class configuration tests
templates:
- templates/persistentVolumeClaim.yaml
tests:
- it: Set storageClassName when persistence.new.storageClassName is defined
- it: "Render the storageClassName when persistence.new.storageClassName is defined"
set:
persistence.enabled: true
persistence.new.storageClassName: my-storage-class
@@ -6,7 +6,7 @@ templates:
- templates/service_ssh.yaml
- templates/service_http.yaml
tests:
- it: supports adding custom labels to sshService
- it: "Add custom labels to the SSH Service"
template: templates/service_ssh.yaml
set:
service:
@@ -18,7 +18,7 @@ tests:
path: metadata.labels["gitea/testkey"]
value: "testvalue"
- it: keeps existing labels (ssh)
- it: "Keep the existing labels of the SSH Service"
template: templates/service_ssh.yaml
set:
service:
@@ -28,7 +28,7 @@ tests:
- exists:
path: metadata.labels["app"]
- it: supports adding custom labels to httpService
- it: "Add custom labels to the HTTP Service"
template: templates/service_http.yaml
set:
service:
@@ -40,7 +40,7 @@ tests:
path: metadata.labels["gitea/testkey"]
value: "testvalue"
- it: keeps existing labels (http)
- it: "Keep the existing labels of the HTTP Service"
template: templates/service_http.yaml
set:
service:
@@ -50,7 +50,7 @@ tests:
- exists:
path: metadata.labels["app"]
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer
- it: "Render service.ssh.loadBalancerClass when the type is LoadBalancer"
template: templates/service_ssh.yaml
set:
service:
@@ -72,7 +72,7 @@ tests:
path: spec.loadBalancerSourceRanges
value: ["1.2.3.4/32", "5.6.7.8/32"]
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass
- it: "Skip the loadBalancer properties when the type is not LoadBalancer"
template: templates/service_http.yaml
set:
service:
@@ -91,7 +91,7 @@ tests:
- notExists:
path: spec.loadBalancerSourceRanges
- it: does not render loadBalancerClass by default even when type is LoadBalancer
- it: "Skip loadBalancerClass by default even when the type is LoadBalancer"
template: templates/service_http.yaml
set:
service:
@@ -105,7 +105,7 @@ tests:
path: spec.loadBalancerIP
value: "1.2.3.4"
- it: both ssh and http services exist
- it: "Render both the SSH and the HTTP Service"
templates:
- templates/service_ssh.yaml
- templates/service_http.yaml
@@ -5,7 +5,7 @@ release:
templates:
- templates/backendTLSPolicy.yaml
tests:
- it: should not render when gatewayAPI.enabled is false
- it: "Skip rendering when gatewayAPI.enabled is false"
set:
gatewayAPI:
enabled: false
@@ -22,7 +22,7 @@ tests:
- hasDocuments:
count: 0
- it: should not render when backendTLSPolicy.enabled is false
- it: "Skip rendering when backendTLSPolicy.enabled is false"
set:
gatewayAPI:
enabled: true
@@ -31,7 +31,7 @@ tests:
- hasDocuments:
count: 0
- it: should render a BackendTLSPolicy targeting the http Service by default
- it: "Render a BackendTLSPolicy targeting the HTTP Service by default"
set:
gatewayAPI:
enabled: true
@@ -65,7 +65,7 @@ tests:
path: spec.validation.hostname
value: git.internal
- it: should fail when validation is missing
- it: "Fail when the validation is missing"
set:
gatewayAPI:
enabled: true
@@ -76,7 +76,7 @@ tests:
- failedTemplate:
errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required
- it: should fail when validation is an empty dict
- it: "Fail when the validation is an empty dict"
set:
gatewayAPI:
enabled: true
@@ -5,7 +5,7 @@ release:
templates:
- templates/clientSettingsPolicy.yaml
tests:
- it: should not render when gatewayAPI.enabled is false
- it: "Skip rendering when gatewayAPI.enabled is false"
set:
gatewayAPI:
enabled: false
@@ -18,7 +18,7 @@ tests:
- hasDocuments:
count: 0
- it: should not render when clientSettingsPolicies.enabled is false
- it: "Skip rendering when clientSettingsPolicies.enabled is false"
set:
gatewayAPI:
enabled: true
@@ -27,7 +27,7 @@ tests:
- hasDocuments:
count: 0
- it: should render a ClientSettingsPolicy targeting the HTTPRoute by default
- it: "Render a ClientSettingsPolicy targeting the HTTPRoute by default"
set:
gatewayAPI:
enabled: true
@@ -60,7 +60,7 @@ tests:
path: spec.body.maxSize
value: 100m
- it: should honor a custom targetRef
- it: "Render a custom targetRef"
set:
gatewayAPI:
enabled: true
@@ -81,7 +81,7 @@ tests:
path: spec.targetRef.name
value: shared-gateway
- it: should fail when body is missing
- it: "Fail when the body is missing"
set:
gatewayAPI:
enabled: true
@@ -92,7 +92,7 @@ tests:
- failedTemplate:
errorMessage: gatewayAPI.nginx.clientSettingsPolicies.body is required
- it: should fail when body is an empty dict
- it: "Fail when the body is an empty dict"
set:
gatewayAPI:
enabled: true
+5 -5
View File
@@ -5,7 +5,7 @@ release:
templates:
- templates/httpRoute.yaml
tests:
- it: should not render when gatewayAPI.enabled is false
- it: "Skip rendering when gatewayAPI.enabled is false"
set:
gatewayAPI:
enabled: false
@@ -20,7 +20,7 @@ tests:
- hasDocuments:
count: 0
- it: should not render when httpRoute.enabled is false
- it: "Skip rendering when httpRoute.enabled is false"
set:
gatewayAPI:
enabled: true
@@ -29,7 +29,7 @@ tests:
- hasDocuments:
count: 0
- it: should render a single HTTPRoute with default rule
- it: "Render a single HTTPRoute with the default rule"
set:
gatewayAPI:
enabled: true
@@ -85,7 +85,7 @@ tests:
path: spec.rules[0].backendRefs[0].weight
value: 1
- it: should fail when parentRefs missing
- it: "Fail when the parentRefs are missing"
set:
gatewayAPI:
enabled: true
@@ -98,7 +98,7 @@ tests:
- failedTemplate:
errorMessage: gatewayAPI.core.httpRoute.parentRefs is required
- it: hostname tpl rendering
- it: "Render the hostnames via tpl"
set:
global:
giteaHostName: gitea.tpl.example.com
+4 -4
View File
@@ -5,7 +5,7 @@ release:
templates:
- templates/tcpRoute.yaml
tests:
- it: should not render when gatewayAPI.enabled is false
- it: "Skip rendering when gatewayAPI.enabled is false"
set:
gatewayAPI:
enabled: false
@@ -18,7 +18,7 @@ tests:
- hasDocuments:
count: 0
- it: should not render when tcpRoute.enabled is false
- it: "Skip rendering when tcpRoute.enabled is false"
set:
gatewayAPI:
enabled: true
@@ -27,7 +27,7 @@ tests:
- hasDocuments:
count: 0
- it: should render a TCPRoute defaulting to the SSH service
- it: "Render a TCPRoute defaulting to the SSH Service"
set:
gatewayAPI:
enabled: true
@@ -67,7 +67,7 @@ tests:
path: spec.rules[0].backendRefs[0].weight
value: 1
- it: should fail when parentRefs missing
- it: "Fail when the parentRefs are missing"
set:
gatewayAPI:
enabled: true
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_gpg.yaml
tests:
- it: renders nothing
- it: "Skip rendering when signing is disabled"
set:
secrets.gpg.enabled: false
asserts:
@@ -5,13 +5,13 @@ release:
templates:
- templates/secret_gpg.yaml
tests:
- it: fails rendering when nothing is configured
- it: "Fail when no gpg key is configured"
set:
secrets.gpg.enabled: true
asserts:
- failedTemplate:
errorMessage: Either specify `secrets.gpg.new.privateKey` or reference an existing Secret via `secrets.gpg.existingSecret`
- it: skips rendering using external secret reference
- it: "Skip rendering when an existing Secret is referenced"
set:
secrets.gpg.enabled: true
secrets.gpg.existingSecret.enabled: true
@@ -19,7 +19,7 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: renders secret specification using inline gpg key
- it: "Render the Secret with an inline gpg key"
set:
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: "gpg-key-placeholder"
+1 -1
View File
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_init.yaml
tests:
- it: renders a secret
- it: "Render the Secret"
asserts:
- hasDocuments:
count: 1
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_init.yaml
tests:
- it: runs gpg in batch mode
- it: "Run gpg in batch mode"
set:
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |-
@@ -21,7 +21,7 @@ tests:
set -eu
gpg --batch --import "$TMP_RAW_GPG_KEY"
- it: skips gpg script block for disabled signing
- it: "Skip the gpg script block when signing is disabled"
asserts:
- equal:
path: data["init_directory_structure.sh"]
@@ -37,7 +37,7 @@ tests:
# prepare temp directory structure
mkdir -pv "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}"
- it: adds gpg script block for enabled signing
- it: "Add the gpg script block when signing is enabled"
set:
secrets.gpg.enabled: true
secrets.gpg.new.privateKey: |-
@@ -65,7 +65,7 @@ tests:
chmod -v 700 "${GNUPGHOME}"
chown -v 1000:1000 "${GNUPGHOME}"
fi
- it: it does not chown /data even when image.fullOverride is set
- it: "Skip the chown of /data even when image.fullOverride is set"
template: templates/secret_init.yaml
set:
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.20.5
@@ -84,7 +84,7 @@ tests:
# prepare temp directory structure
mkdir -pv "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}"
- it: renders data, not stringData, so removed keys are pruned on upgrade
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
asserts:
- notExists:
path: stringData
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_init.yaml
tests:
- it: runs gpg in batch mode
- it: "Run gpg in batch mode"
set:
deployment.gitea.image.rootless: false
secrets.gpg.enabled: true
@@ -22,7 +22,7 @@ tests:
set -eu
gpg --batch --import "$TMP_RAW_GPG_KEY"
- it: skips gpg script block for disabled signing
- it: "Skip the gpg script block when signing is disabled"
set:
deployment.gitea.image.rootless: false
asserts:
@@ -42,7 +42,7 @@ tests:
mkdir -pv "${GITEA_TEMP}"
chown -v 1000:1000 "${GITEA_TEMP}"
chmod -v ug+rwx "${GITEA_TEMP}"
- it: adds gpg script block for enabled signing
- it: "Add the gpg script block when signing is enabled"
set:
deployment.gitea.image.rootless: false
secrets.gpg.enabled: true
@@ -73,7 +73,7 @@ tests:
chmod -v 700 "${GNUPGHOME}"
chown -v 1000:1000 "${GNUPGHOME}"
fi
- it: renders data, not stringData, so removed keys are pruned on upgrade
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
set:
deployment.gitea.image.rootless: false
asserts:
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_metrics.yaml
tests:
- it: renders nothing if monitoring disabled and gitea.metrics.token empty
- it: "Skip rendering when monitoring is disabled and gitea.metrics.token is empty"
set:
gitea.metrics.enabled: false
gitea.metrics.serviceMonitor.enabled: false
@@ -13,7 +13,7 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: renders nothing if monitoring disabled and gitea.metrics.token not empty
- it: "Skip rendering when monitoring is disabled and gitea.metrics.token is not empty"
set:
gitea.metrics.enabled: false
gitea.metrics.serviceMonitor.enabled: false
@@ -5,7 +5,7 @@ release:
templates:
- templates/secret_metrics.yaml
tests:
- it: renders nothing if monitoring enabled and gitea.metrics.token empty
- it: "Skip rendering when monitoring is enabled and gitea.metrics.token is empty"
set:
gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true
@@ -13,7 +13,7 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: renders Secret if monitoring enabled and gitea.metrics.token not empty
- it: "Render the Secret when monitoring is enabled and gitea.metrics.token is not empty"
set:
gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true
+2 -2
View File
@@ -5,7 +5,7 @@ release:
templates:
- templates/route.yaml
tests:
- it: should create route when route.enabled is true
- it: "Render the Route when route.enabled is true"
set:
route:
enabled: true
@@ -50,7 +50,7 @@ tests:
path: spec.tls.insecureEdgeTerminationPolicy
value: Redirect
- it: should not create route when route.enabled is false
- it: "Skip rendering when route.enabled is false"
set:
route.enabled: false
asserts:
+6 -6
View File
@@ -5,23 +5,23 @@ release:
templates:
- templates/serviceMonitor.yaml
tests:
- it: skips rendering by default
- it: "Skip rendering by default"
asserts:
- hasDocuments:
count: 0
- it: renders default ServiceMonitor object with gitea.metrics.enabled=true
- it: "Render the ServiceMonitor when gitea.metrics.enabled is true"
set:
gitea.metrics.enabled: true
asserts:
- hasDocuments:
count: 0
- it: renders default ServiceMonitor object with gitea.metrics.serviceMonitor.enabled=true
- it: "Render the ServiceMonitor when gitea.metrics.serviceMonitor.enabled is true"
set:
gitea.metrics.serviceMonitor.enabled: true
asserts:
- hasDocuments:
count: 0
- it: renders defaults
- it: "Render the default ServiceMonitor spec"
set:
gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true
@@ -45,7 +45,7 @@ tests:
path: spec.endpoints[0].scrapeTimeout
- notExists:
path: spec.endpoints[0].tlsConfig
- it: renders custom scrape interval
- it: "Render a custom scrape interval"
set:
gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true
@@ -58,7 +58,7 @@ tests:
- equal:
path: spec.endpoints[0].scrapeTimeout
value: 5s
- it: renders custom tls config
- it: "Render a custom tls config"
set:
gitea.metrics.enabled: true
gitea.metrics.serviceMonitor.enabled: true
@@ -5,7 +5,7 @@ release:
templates:
- templates/serviceMonitor.yaml
tests:
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty
- it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is empty"
set:
gitea.metrics.enabled: false
gitea.metrics.token: ""
@@ -13,7 +13,7 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token not empty
- it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is not empty"
set:
gitea.metrics.enabled: false
gitea.metrics.token: "test-token"
@@ -5,7 +5,7 @@ release:
templates:
- templates/serviceMonitor.yaml
tests:
- it: renders unsecure ServiceMonitor if gitea.metrics.token nil
- it: "Render an unsecured ServiceMonitor when gitea.metrics.token is nil"
set:
gitea.metrics.enabled: true
gitea.metrics.token:
@@ -24,7 +24,7 @@ tests:
path: spec.endpoints
value:
- port: http
- it: renders unsecure ServiceMonitor if gitea.metrics.token empty
- it: "Render an unsecured ServiceMonitor when gitea.metrics.token is empty"
set:
gitea.metrics.enabled: true
gitea.metrics.token: ""
@@ -43,7 +43,7 @@ tests:
path: spec.endpoints
value:
- port: http
- it: renders secure ServiceMonitor if gitea.metrics.token not empty
- it: "Render a secured ServiceMonitor when gitea.metrics.token is not empty"
set:
gitea.metrics.enabled: true
gitea.metrics.token: "test-token"