diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e80892d..4fb3a90 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -52,8 +52,9 @@ data: ### Unit Tests -- Helm unit tests live in `unittests/helm/` mirroring the template structure. +- Helm unit tests live in `unittests/helm/` mirroring the template structure. A suite belongs into the directory of the template it asserts on, never into the directory of a template it only renders as a side effect. - Test files are YAML using the [helm-unittest](https://github.com/helm-unittest/helm-unittest) format. +- Name test files in camelCase after the scenario they cover (e.g. `signingEnabled.yaml`), use `basics.yaml` for the default scenario and do not repeat the directory name in the file name. The `make helm/unittest` glob only matches one directory level, so every suite must live in a subdirectory. - Each test must set all required values explicitly — do not rely on cross-test state. - The `values.yaml` file must pass `yamllint`. The configuration is in `.yamllint.yaml`. Use `make yamllint` to run the linter. - The title of the unit test should clearly describe the scenario being tested. As title must be use a short sentence starting with a capital letter and ending without a period. diff --git a/Makefile b/Makefile index 4298838..5c3972a 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ helm/dependency-update: # ============================================================================== PHONY+=helm/unittest helm/unittest: - helm unittest --strict --file 'unittests/helm/**/*.yaml' --file 'unittests/helm/values-conflicting-checks.yaml' ./ + helm unittest --strict --file 'unittests/helm/**/*.yaml' ./ # BASH PREPARE # ============================================================================== diff --git a/unittests/helm/admin-secret/admin.yaml b/unittests/helm/admin-secret/basics.yaml similarity index 100% rename from unittests/helm/admin-secret/admin.yaml rename to unittests/helm/admin-secret/basics.yaml diff --git a/unittests/helm/config/actions-config.yaml b/unittests/helm/config/actions.yaml similarity index 100% rename from unittests/helm/config/actions-config.yaml rename to unittests/helm/config/actions.yaml diff --git a/unittests/helm/config/cache-config.yaml b/unittests/helm/config/cache.yaml similarity index 100% rename from unittests/helm/config/cache-config.yaml rename to unittests/helm/config/cache.yaml diff --git a/unittests/helm/config/config-environment-script.yaml b/unittests/helm/config/environmentScript.yaml similarity index 100% rename from unittests/helm/config/config-environment-script.yaml rename to unittests/helm/config/environmentScript.yaml diff --git a/unittests/helm/deployment/inline-config.yaml b/unittests/helm/config/inlineConfig.yaml similarity index 97% rename from unittests/helm/deployment/inline-config.yaml rename to unittests/helm/config/inlineConfig.yaml index ab9dd37..e9d2dd3 100644 --- a/unittests/helm/deployment/inline-config.yaml +++ b/unittests/helm/config/inlineConfig.yaml @@ -1,4 +1,4 @@ -suite: Test deployment inline config +suite: Test config inlineConfig release: name: gitea-unittests namespace: testing diff --git a/unittests/helm/config/metrics-section_metrics-token.yaml b/unittests/helm/config/metricsToken.yaml similarity index 100% rename from unittests/helm/config/metrics-section_metrics-token.yaml rename to unittests/helm/config/metricsToken.yaml diff --git a/unittests/helm/config/queue-config.yaml b/unittests/helm/config/queue.yaml similarity index 100% rename from unittests/helm/config/queue-config.yaml rename to unittests/helm/config/queue.yaml diff --git a/unittests/helm/config/server-section_domain.yaml b/unittests/helm/config/serverDomain.yaml similarity index 100% rename from unittests/helm/config/server-section_domain.yaml rename to unittests/helm/config/serverDomain.yaml diff --git a/unittests/helm/config/session-config.yaml b/unittests/helm/config/session.yaml similarity index 100% rename from unittests/helm/config/session-config.yaml rename to unittests/helm/config/session.yaml diff --git a/unittests/helm/dependency-checks/customization-integrity-postgresql.yaml b/unittests/helm/dependency-checks/customizationIntegrityPostgresql.yaml similarity index 100% rename from unittests/helm/dependency-checks/customization-integrity-postgresql.yaml rename to unittests/helm/dependency-checks/customizationIntegrityPostgresql.yaml diff --git a/unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml b/unittests/helm/dependency-checks/customizationIntegrityPostgresqlHA.yaml similarity index 100% rename from unittests/helm/dependency-checks/customization-integrity-postgresql-ha.yaml rename to unittests/helm/dependency-checks/customizationIntegrityPostgresqlHA.yaml diff --git a/unittests/helm/dependency-checks/customization-integrity-valkey.yaml b/unittests/helm/dependency-checks/customizationIntegrityValkey.yaml similarity index 100% rename from unittests/helm/dependency-checks/customization-integrity-valkey.yaml rename to unittests/helm/dependency-checks/customizationIntegrityValkey.yaml diff --git a/unittests/helm/dependency-checks/major-image-bump.yaml b/unittests/helm/dependency-checks/majorImageBump.yaml similarity index 100% rename from unittests/helm/dependency-checks/major-image-bump.yaml rename to unittests/helm/dependency-checks/majorImageBump.yaml diff --git a/unittests/helm/deployment/deployment-additional-config.yaml b/unittests/helm/deployment/additionalConfig.yaml similarity index 100% rename from unittests/helm/deployment/deployment-additional-config.yaml rename to unittests/helm/deployment/additionalConfig.yaml diff --git a/unittests/helm/deployment/admin.yaml b/unittests/helm/deployment/adminUser.yaml similarity index 100% rename from unittests/helm/deployment/admin.yaml rename to unittests/helm/deployment/adminUser.yaml diff --git a/unittests/helm/deployment/basic.yaml b/unittests/helm/deployment/basics.yaml similarity index 100% rename from unittests/helm/deployment/basic.yaml rename to unittests/helm/deployment/basics.yaml diff --git a/unittests/helm/deployment/checksum-annotations.yaml b/unittests/helm/deployment/checksumAnnotations.yaml similarity index 100% rename from unittests/helm/deployment/checksum-annotations.yaml rename to unittests/helm/deployment/checksumAnnotations.yaml diff --git a/unittests/helm/deployment/HA.yaml b/unittests/helm/deployment/highAvailability.yaml similarity index 100% rename from unittests/helm/deployment/HA.yaml rename to unittests/helm/deployment/highAvailability.yaml diff --git a/unittests/helm/deployment/image-configuration.yaml b/unittests/helm/deployment/imageConfiguration.yaml similarity index 100% rename from unittests/helm/deployment/image-configuration.yaml rename to unittests/helm/deployment/imageConfiguration.yaml diff --git a/unittests/helm/deployment/sidecar-container.yaml b/unittests/helm/deployment/sidecarContainer.yaml similarity index 100% rename from unittests/helm/deployment/sidecar-container.yaml rename to unittests/helm/deployment/sidecarContainer.yaml diff --git a/unittests/helm/deployment/signing-disabled.yaml b/unittests/helm/deployment/signingDisabled.yaml similarity index 100% rename from unittests/helm/deployment/signing-disabled.yaml rename to unittests/helm/deployment/signingDisabled.yaml diff --git a/unittests/helm/deployment/signing-enabled.yaml b/unittests/helm/deployment/signingEnabled.yaml similarity index 100% rename from unittests/helm/deployment/signing-enabled.yaml rename to unittests/helm/deployment/signingEnabled.yaml diff --git a/unittests/helm/deployment/ssh-configuration.yaml b/unittests/helm/deployment/sshConfiguration.yaml similarity index 100% rename from unittests/helm/deployment/ssh-configuration.yaml rename to unittests/helm/deployment/sshConfiguration.yaml diff --git a/unittests/helm/deployment/deprecations.yaml b/unittests/helm/deprecation/deployment.yaml similarity index 100% rename from unittests/helm/deployment/deprecations.yaml rename to unittests/helm/deprecation/deployment.yaml diff --git a/unittests/helm/gpg-secret/signing-disabled.yaml b/unittests/helm/gpg-secret/signingDisabled.yaml similarity index 100% rename from unittests/helm/gpg-secret/signing-disabled.yaml rename to unittests/helm/gpg-secret/signingDisabled.yaml diff --git a/unittests/helm/gpg-secret/signing-enabled.yaml b/unittests/helm/gpg-secret/signingEnabled.yaml similarity index 100% rename from unittests/helm/gpg-secret/signing-enabled.yaml rename to unittests/helm/gpg-secret/signingEnabled.yaml diff --git a/unittests/helm/ingress/ingress.yaml b/unittests/helm/ingress/basics.yaml similarity index 100% rename from unittests/helm/ingress/ingress.yaml rename to unittests/helm/ingress/basics.yaml diff --git a/unittests/helm/init/basic.yaml b/unittests/helm/init/basics.yaml similarity index 100% rename from unittests/helm/init/basic.yaml rename to unittests/helm/init/basics.yaml diff --git a/unittests/helm/init/init_directory_structure.sh.yaml b/unittests/helm/init/directoryStructureScript.yaml similarity index 100% rename from unittests/helm/init/init_directory_structure.sh.yaml rename to unittests/helm/init/directoryStructureScript.yaml diff --git a/unittests/helm/init/init_directory_structure.sh-rootless.yaml b/unittests/helm/init/directoryStructureScriptRootless.yaml similarity index 100% rename from unittests/helm/init/init_directory_structure.sh-rootless.yaml rename to unittests/helm/init/directoryStructureScriptRootless.yaml diff --git a/unittests/helm/metric-secret/metrics-secret-servicemonitor-disabled.yaml b/unittests/helm/metric-secret/monitoringDisabled.yaml similarity index 100% rename from unittests/helm/metric-secret/metrics-secret-servicemonitor-disabled.yaml rename to unittests/helm/metric-secret/monitoringDisabled.yaml diff --git a/unittests/helm/metric-secret/metrics-secret-servicemonitor-enabled.yaml b/unittests/helm/metric-secret/monitoringEnabled.yaml similarity index 100% rename from unittests/helm/metric-secret/metrics-secret-servicemonitor-enabled.yaml rename to unittests/helm/metric-secret/monitoringEnabled.yaml diff --git a/unittests/helm/persistentVolumeClaim/persistentVolumeClaim.yaml b/unittests/helm/persistentVolumeClaim/basics.yaml similarity index 100% rename from unittests/helm/persistentVolumeClaim/persistentVolumeClaim.yaml rename to unittests/helm/persistentVolumeClaim/basics.yaml diff --git a/unittests/helm/deployment/storage-class-configuration.yaml b/unittests/helm/persistentVolumeClaim/storageClass.yaml similarity index 89% rename from unittests/helm/deployment/storage-class-configuration.yaml rename to unittests/helm/persistentVolumeClaim/storageClass.yaml index 929ce9a..8dd9ec8 100644 --- a/unittests/helm/deployment/storage-class-configuration.yaml +++ b/unittests/helm/persistentVolumeClaim/storageClass.yaml @@ -3,7 +3,7 @@ chart: release: name: gitea-unittests namespace: testing -suite: Test deployment storage class configuration +suite: Test persistentVolumeClaim storage class templates: - templates/persistentVolumeClaim.yaml tests: diff --git a/unittests/helm/route/basic.yaml b/unittests/helm/route/basics.yaml similarity index 100% rename from unittests/helm/route/basic.yaml rename to unittests/helm/route/basics.yaml diff --git a/unittests/helm/deployment/svc-configuration.yaml b/unittests/helm/service/configuration.yaml similarity index 100% rename from unittests/helm/deployment/svc-configuration.yaml rename to unittests/helm/service/configuration.yaml diff --git a/unittests/helm/serviceAccount/serviceAccount.yaml b/unittests/helm/serviceAccount/basics.yaml similarity index 100% rename from unittests/helm/serviceAccount/serviceAccount.yaml rename to unittests/helm/serviceAccount/basics.yaml diff --git a/unittests/helm/servicemonitor/basic.yaml b/unittests/helm/servicemonitor/basics.yaml similarity index 100% rename from unittests/helm/servicemonitor/basic.yaml rename to unittests/helm/servicemonitor/basics.yaml diff --git a/unittests/helm/servicemonitor/servicemonitor-disabled.yaml b/unittests/helm/servicemonitor/monitoringDisabled.yaml similarity index 100% rename from unittests/helm/servicemonitor/servicemonitor-disabled.yaml rename to unittests/helm/servicemonitor/monitoringDisabled.yaml diff --git a/unittests/helm/servicemonitor/servicemonitor-enabled.yaml b/unittests/helm/servicemonitor/monitoringEnabled.yaml similarity index 100% rename from unittests/helm/servicemonitor/servicemonitor-enabled.yaml rename to unittests/helm/servicemonitor/monitoringEnabled.yaml