From 255e739d13a9f30cf84265906140eb4f6bbd9798 Mon Sep 17 00:00:00 2001 From: Koen van Zuijlen <8818390+kvanzuijlen@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:17:26 +0100 Subject: [PATCH] chore: Updated helm-unittest to 0.3.6 + made tests compatible (#974) --- .github/workflows/lint-test.yaml | 2 +- CONTRIBUTING.md | 4 +- charts/jenkins/CHANGELOG.md | 4 + charts/jenkins/Chart.yaml | 2 +- .../unittests/config-init-scripts-test.yaml | 2 +- charts/jenkins/unittests/config-test.yaml | 14 +- charts/jenkins/unittests/home-pvc-test.yaml | 2 +- .../jenkins/unittests/jcasc-config-test.yaml | 134 +++++++++--------- .../unittests/jenkins-agent-svc-test.yaml | 4 +- ...enkins-controller-alerting-rules-test.yaml | 6 +- .../jenkins-controller-ingress-1.19-test.yaml | 2 +- .../jenkins-controller-ingress-test.yaml | 2 +- ...jenkins-controller-networkpolicy-test.yaml | 2 +- .../jenkins-controller-pdb-1.21-test.yaml | 2 +- .../jenkins-controller-pdb-test.yaml | 2 +- ...ontroller-secondary-ingress-1.19-test.yaml | 2 +- ...ins-controller-secondary-ingress-test.yaml | 4 +- ...enkins-controller-servicemonitor_test.yaml | 2 +- .../jenkins-controller-statefulset-test.yaml | 2 +- .../jenkins-controller-svc-test.yaml | 2 +- charts/jenkins/unittests/rbac-test.yaml | 2 +- .../unittests/secret-additional-test.yaml | 2 +- .../jenkins/unittests/secret-claims-test.yaml | 6 +- charts/jenkins/unittests/secret-test.yaml | 2 +- .../unittests/service-account-agent-test.yaml | 12 +- .../unittests/service-account-test.yaml | 10 +- ct.yaml | 2 +- 27 files changed, 118 insertions(+), 114 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 8c281cc8e..c9b76cc47 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -50,7 +50,7 @@ jobs: if: steps.list-changed.outputs.changed == 'true' run: | helm env - helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11 + helm plugin install https://github.com/helm-unittest/helm-unittest --version 0.3.6 - name: Run chart-testing (lint) run: ct lint --config ct.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d622df16a..d7b1d4f19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,10 +43,10 @@ Tests can be executed like this: ```console # install the unittest plugin -$ helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11 +$ helm plugin install https://github.com/helm-unittest/helm-unittest --version 0.3.6 # run the unittests -$ helm unittest --helm3 --strict -f 'unittests/*.yaml' charts/jenkins +$ helm unittest --strict -f 'unittests/*.yaml' charts/jenkins ### Chart [ jenkins ] charts/jenkins diff --git a/charts/jenkins/CHANGELOG.md b/charts/jenkins/CHANGELOG.md index f4796f8e6..8dea69731 100644 --- a/charts/jenkins/CHANGELOG.md +++ b/charts/jenkins/CHANGELOG.md @@ -12,6 +12,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0. The changelog until v1.5.7 was auto-generated based on git commits. Those entries include a reference to the git commit to be able to get more details. +## 4.11.1 + +Updated helm-unittest and made unittests compatible. + ## 4.11.0 Add multi-cloud support. diff --git a/charts/jenkins/Chart.yaml b/charts/jenkins/Chart.yaml index 663049ff4..01ca7e777 100644 --- a/charts/jenkins/Chart.yaml +++ b/charts/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: jenkins home: https://jenkins.io/ -version: 4.11.0 +version: 4.11.1 appVersion: 2.426.2 description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides over 1800 plugins to support building, deploying and automating any project. sources: diff --git a/charts/jenkins/unittests/config-init-scripts-test.yaml b/charts/jenkins/unittests/config-init-scripts-test.yaml index b524460ca..b0b7d1795 100644 --- a/charts/jenkins/unittests/config-init-scripts-test.yaml +++ b/charts/jenkins/unittests/config-init-scripts-test.yaml @@ -14,6 +14,6 @@ tests: - hasDocuments: count: 1 - equal: - path: data.inittest\.groovy + path: data["inittest.groovy"] value: |- my script here val here diff --git a/charts/jenkins/unittests/config-test.yaml b/charts/jenkins/unittests/config-test.yaml index 36b8ce6bd..566d7f851 100644 --- a/charts/jenkins/unittests/config-test.yaml +++ b/charts/jenkins/unittests/config-test.yaml @@ -16,7 +16,7 @@ tests: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: jenkins - equal: - path: data.apply_config\.sh + path: data["apply_config.sh"] value: |- set -e echo "disable Setup Wizard" @@ -38,7 +38,7 @@ tests: yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/; echo "finished initialization" - equal: - path: data.plugins\.txt + path: data["plugins.txt"] value: |- kubernetes:4029.v5712230ccb_f8 workflow-aggregator:596.v8c21c963d92d @@ -49,7 +49,7 @@ tests: controller.installPlugins: [] asserts: - equal: - path: data.apply_config\.sh + path: data["apply_config.sh"] value: |- set -e echo "disable Setup Wizard" @@ -58,7 +58,7 @@ tests: echo $JENKINS_VERSION > /var/jenkins_home/jenkins.install.InstallUtil.lastExecVersion echo "finished initialization" - equal: - path: data.plugins\.txt + path: data["plugins.txt"] value: "" - it: additional plugins config set: @@ -67,7 +67,7 @@ tests: - kubernetes-credentials-provider asserts: - equal: - path: data.plugins\.txt + path: data["plugins.txt"] value: |- kubernetes:4029.v5712230ccb_f8 workflow-aggregator:596.v8c21c963d92d @@ -79,7 +79,7 @@ tests: controller.installLatestPlugins: false asserts: - equal: - path: data.apply_config\.sh + path: data["apply_config.sh"] value: |- set -e echo "disable Setup Wizard" @@ -105,7 +105,7 @@ tests: controller.installLatestSpecifiedPlugins: true asserts: - equal: - path: data.apply_config\.sh + path: data["apply_config.sh"] value: |- set -e echo "disable Setup Wizard" diff --git a/charts/jenkins/unittests/home-pvc-test.yaml b/charts/jenkins/unittests/home-pvc-test.yaml index 144552436..b213bda17 100644 --- a/charts/jenkins/unittests/home-pvc-test.yaml +++ b/charts/jenkins/unittests/home-pvc-test.yaml @@ -19,7 +19,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jcasc-config-test.yaml b/charts/jenkins/unittests/jcasc-config-test.yaml index d918bb9d2..d6c49cb00 100644 --- a/charts/jenkins/unittests/jcasc-config-test.yaml +++ b/charts/jenkins/unittests/jcasc-config-test.yaml @@ -11,12 +11,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -142,7 +142,7 @@ tests: asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -411,7 +411,7 @@ tests: isKind: of: ConfigMap - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - documentIndex: 0 equal: @@ -422,7 +422,7 @@ tests: path: metadata.namespace value: other - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - documentIndex: 1 isKind: @@ -452,7 +452,7 @@ tests: systemMessage: Welcome to our CI\CD server. This Jenkins is configured and managed 'as code'. - documentIndex: 1 equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -591,12 +591,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -698,12 +698,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -803,12 +803,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -910,12 +910,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1018,12 +1018,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1125,12 +1125,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1236,7 +1236,7 @@ tests: agent.enabled: false asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1302,12 +1302,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1402,12 +1402,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1506,12 +1506,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1606,12 +1606,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1704,7 +1704,7 @@ tests: projectNamingStrategy: asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1797,7 +1797,7 @@ tests: mySetting2: something asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1894,7 +1894,7 @@ tests: sshHostKeyVerificationStrategy: "acceptFirstConnectionStrategy" asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -1989,7 +1989,7 @@ tests: apiToken: overridden asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2083,7 +2083,7 @@ tests: privileged: true asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2207,7 +2207,7 @@ tests: args: arg1 arg2 asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2375,7 +2375,7 @@ tests: additionalContainers: [] asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2515,7 +2515,7 @@ tests: hostNetworking: true asserts: - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2617,12 +2617,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2726,12 +2726,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2831,12 +2831,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -2950,12 +2950,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -3077,12 +3077,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -3235,12 +3235,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: @@ -3457,12 +3457,12 @@ tests: - hasDocuments: count: 1 - isNotEmpty: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: - path: data.jcasc-default-config\.yaml + path: data["jcasc-default-config.yaml"] value: |- jenkins: authorizationStrategy: diff --git a/charts/jenkins/unittests/jenkins-agent-svc-test.yaml b/charts/jenkins/unittests/jenkins-agent-svc-test.yaml index ec1048a9d..4b0367c65 100644 --- a/charts/jenkins/unittests/jenkins-agent-svc-test.yaml +++ b/charts/jenkins/unittests/jenkins-agent-svc-test.yaml @@ -19,7 +19,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations @@ -127,4 +127,4 @@ tests: agentListenerEnabled: false asserts: - hasDocuments: - count: 0 \ No newline at end of file + count: 0 diff --git a/charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml b/charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml index bdeece874..98b1a8436 100644 --- a/charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml @@ -33,13 +33,13 @@ tests: path: metadata.name value: my-release-jenkins - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: path: spec @@ -76,4 +76,4 @@ tests: app.kubernetes.io/component: jenkins-controller app.kubernetes.io/instance: my-release app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: jenkins \ No newline at end of file + app.kubernetes.io/name: jenkins diff --git a/charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml b/charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml index 0183331be..a9f8b38e4 100644 --- a/charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml @@ -35,7 +35,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-ingress-test.yaml b/charts/jenkins/unittests/jenkins-controller-ingress-test.yaml index 6508d7e65..15bf17287 100644 --- a/charts/jenkins/unittests/jenkins-controller-ingress-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-ingress-test.yaml @@ -35,7 +35,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml b/charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml index 09047ff1c..80ffd2657 100644 --- a/charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml @@ -24,7 +24,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-pdb-1.21-test.yaml b/charts/jenkins/unittests/jenkins-controller-pdb-1.21-test.yaml index c9b6bb759..0c1fd882a 100644 --- a/charts/jenkins/unittests/jenkins-controller-pdb-1.21-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-pdb-1.21-test.yaml @@ -30,7 +30,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-pdb-test.yaml b/charts/jenkins/unittests/jenkins-controller-pdb-test.yaml index 7a43bfc9f..c3251c6ad 100644 --- a/charts/jenkins/unittests/jenkins-controller-pdb-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-pdb-test.yaml @@ -30,7 +30,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml index 8df3a3493..3c28e52ad 100644 --- a/charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml @@ -37,7 +37,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml index b5aed8c46..cd8a0a3c2 100644 --- a/charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml @@ -14,7 +14,7 @@ tests: count: 0 - it: enabled set: - controller.secondaryingress: + "controller.secondaryingress": enabled: true hostName: jenkins.example.com ingressClassName: nginx @@ -37,7 +37,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml b/charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml index a847061e3..2c12ed57c 100644 --- a/charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml @@ -25,7 +25,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: path: spec diff --git a/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml b/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml index cbe4e61a5..d8dc50b84 100644 --- a/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml @@ -22,7 +22,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/jenkins-controller-svc-test.yaml b/charts/jenkins/unittests/jenkins-controller-svc-test.yaml index f1349ee5d..72c312911 100644 --- a/charts/jenkins/unittests/jenkins-controller-svc-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-svc-test.yaml @@ -19,7 +19,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/rbac-test.yaml b/charts/jenkins/unittests/rbac-test.yaml index 592373ea9..bdfea319f 100644 --- a/charts/jenkins/unittests/rbac-test.yaml +++ b/charts/jenkins/unittests/rbac-test.yaml @@ -145,7 +145,7 @@ tests: - hasDocuments: count: 6 - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - it: disable helm.sh label diff --git a/charts/jenkins/unittests/secret-additional-test.yaml b/charts/jenkins/unittests/secret-additional-test.yaml index 99d445609..d075f87a2 100644 --- a/charts/jenkins/unittests/secret-additional-test.yaml +++ b/charts/jenkins/unittests/secret-additional-test.yaml @@ -29,7 +29,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/secret-claims-test.yaml b/charts/jenkins/unittests/secret-claims-test.yaml index d7ca286eb..04bd88463 100644 --- a/charts/jenkins/unittests/secret-claims-test.yaml +++ b/charts/jenkins/unittests/secret-claims-test.yaml @@ -34,7 +34,7 @@ tests: value: my-release-jenkins-simple-secret - documentIndex: 0 matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - documentIndex: 0 isNull: @@ -63,7 +63,7 @@ tests: value: my-release-jenkins-complex-secret - documentIndex: 1 matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - documentIndex: 1 isNull: @@ -79,4 +79,4 @@ tests: - documentIndex: 1 equal: path: spec.renew - value: 60 \ No newline at end of file + value: 60 diff --git a/charts/jenkins/unittests/secret-test.yaml b/charts/jenkins/unittests/secret-test.yaml index 12ea5c17e..9cf3301f0 100644 --- a/charts/jenkins/unittests/secret-test.yaml +++ b/charts/jenkins/unittests/secret-test.yaml @@ -19,7 +19,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations diff --git a/charts/jenkins/unittests/service-account-agent-test.yaml b/charts/jenkins/unittests/service-account-agent-test.yaml index 26d26e087..b1eea0532 100644 --- a/charts/jenkins/unittests/service-account-agent-test.yaml +++ b/charts/jenkins/unittests/service-account-agent-test.yaml @@ -26,7 +26,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations @@ -51,7 +51,7 @@ tests: path: metadata.namespace value: agents - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - equal: path: metadata.annotations @@ -90,14 +90,14 @@ tests: "this.is.another.test.label": "with a different value" asserts: - equal: - path: metadata.labels.\app\.kubernetes\.io/name + path: metadata.labels["app.kubernetes.io/name"] value: "jenkins" - equal: - path: metadata.labels.app\.kubernetes\.io/managed-by + path: metadata.labels["app.kubernetes.io/managed-by"] value: "Helm" - equal: - path: metadata.labels.this\.\is\.a\.test\.label + path: metadata.labels["this.is.a.test.label"] value: "with a value" - equal: - path: metadata.labels.this\.is\.another\.test\.label + path: metadata.labels["this.is.another.test.label"] value: "with a different value" diff --git a/charts/jenkins/unittests/service-account-test.yaml b/charts/jenkins/unittests/service-account-test.yaml index 4aa20fe75..e0c755a26 100644 --- a/charts/jenkins/unittests/service-account-test.yaml +++ b/charts/jenkins/unittests/service-account-test.yaml @@ -19,7 +19,7 @@ tests: path: metadata.namespace value: my-namespace - matchRegex: - path: metadata.labels.helm\.sh/chart + path: metadata.labels["helm.sh/chart"] pattern: ^jenkins- - isNull: path: metadata.annotations @@ -64,14 +64,14 @@ tests: "this.is.another.test.label": "with a different value" asserts: - equal: - path: metadata.labels.\app\.kubernetes\.io/name + path: metadata.labels["app.kubernetes.io/name"] value: "jenkins" - equal: - path: metadata.labels.app\.kubernetes\.io/managed-by + path: metadata.labels["app.kubernetes.io/managed-by"] value: "Helm" - equal: - path: metadata.labels.this\.\is\.a\.test\.label + path: metadata.labels["this.is.a.test.label"] value: "with a value" - equal: - path: metadata.labels.this\.is\.another\.test\.label + path: metadata.labels["this.is.another.test.label"] value: "with a different value" diff --git a/ct.yaml b/ct.yaml index 0bcc28361..eb4f211dc 100644 --- a/ct.yaml +++ b/ct.yaml @@ -5,4 +5,4 @@ chart-dirs: - charts helm-extra-args: --timeout 600s additional-commands: - - helm unittest --helm3 --strict -f 'unittests/*.yaml' {{ .Path }} + - helm unittest --strict -f 'unittests/*.yaml' {{ .Path }}