diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 8d9ba94fc..9b5b066b6 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.4 + helm plugin install https://github.com/quintush/helm-unittest --version 0.2.6 - name: Run chart-testing (lint) run: ct lint --config ct.yaml diff --git a/charts/jenkins/.helmignore b/charts/jenkins/.helmignore index b4af6c204..701e6bcd5 100644 --- a/charts/jenkins/.helmignore +++ b/charts/jenkins/.helmignore @@ -20,3 +20,7 @@ .idea/ *.tmproj ci/ +# do not package unittests +unittests/ +Tiltfile +.helmignore diff --git a/charts/jenkins/CHANGELOG.md b/charts/jenkins/CHANGELOG.md index 8b944f401..e763d11d2 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 change log 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. +## 3.5.4 + +Update tests to work with unittest 0.2.6 + ## 3.5.3 Update Jenkins image and appVersion to jenkins lts release version 2.289.2 diff --git a/charts/jenkins/Chart.yaml b/charts/jenkins/Chart.yaml index 168433985..43dd09380 100644 --- a/charts/jenkins/Chart.yaml +++ b/charts/jenkins/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: jenkins home: https://jenkins.io/ -version: 3.5.3 +version: 3.5.4 appVersion: 2.289.2 description: Jenkins - Build great things at any scale! The leading open source automation server, Jenkins provides hundreds of plugins to support building, deploying and automating any project. sources: diff --git a/charts/jenkins/tests/__snapshot__/jenkins-controller-statefulset-test.yaml.snap b/charts/jenkins/unittests/__snapshot__/jenkins-controller-statefulset-test.yaml.snap similarity index 100% rename from charts/jenkins/tests/__snapshot__/jenkins-controller-statefulset-test.yaml.snap rename to charts/jenkins/unittests/__snapshot__/jenkins-controller-statefulset-test.yaml.snap diff --git a/charts/jenkins/tests/config-test.yaml b/charts/jenkins/unittests/config-test.yaml similarity index 100% rename from charts/jenkins/tests/config-test.yaml rename to charts/jenkins/unittests/config-test.yaml diff --git a/charts/jenkins/tests/home-pvc-test.yaml b/charts/jenkins/unittests/home-pvc-test.yaml similarity index 100% rename from charts/jenkins/tests/home-pvc-test.yaml rename to charts/jenkins/unittests/home-pvc-test.yaml diff --git a/charts/jenkins/tests/jcasc-config-test.yaml b/charts/jenkins/unittests/jcasc-config-test.yaml similarity index 100% rename from charts/jenkins/tests/jcasc-config-test.yaml rename to charts/jenkins/unittests/jcasc-config-test.yaml diff --git a/charts/jenkins/tests/jenkins-agent-svc-test.yaml b/charts/jenkins/unittests/jenkins-agent-svc-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-agent-svc-test.yaml rename to charts/jenkins/unittests/jenkins-agent-svc-test.yaml diff --git a/charts/jenkins/tests/jenkins-backup-cronjob-test.yaml b/charts/jenkins/unittests/jenkins-backup-cronjob-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-backup-cronjob-test.yaml rename to charts/jenkins/unittests/jenkins-backup-cronjob-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-alerting-rules-test.yaml b/charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-alerting-rules-test.yaml rename to charts/jenkins/unittests/jenkins-controller-alerting-rules-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-ingress-1.19-test.yaml b/charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-ingress-1.19-test.yaml rename to charts/jenkins/unittests/jenkins-controller-ingress-1.19-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-ingress-test.yaml b/charts/jenkins/unittests/jenkins-controller-ingress-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-ingress-test.yaml rename to charts/jenkins/unittests/jenkins-controller-ingress-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-networkpolicy-test.yaml b/charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-networkpolicy-test.yaml rename to charts/jenkins/unittests/jenkins-controller-networkpolicy-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-secondary-ingress-1.19-test.yaml b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-secondary-ingress-1.19-test.yaml rename to charts/jenkins/unittests/jenkins-controller-secondary-ingress-1.19-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-secondary-ingress-test.yaml b/charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-secondary-ingress-test.yaml rename to charts/jenkins/unittests/jenkins-controller-secondary-ingress-test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-servicemonitor_test.yaml b/charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-servicemonitor_test.yaml rename to charts/jenkins/unittests/jenkins-controller-servicemonitor_test.yaml diff --git a/charts/jenkins/tests/jenkins-controller-statefulset-test.yaml b/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml similarity index 95% rename from charts/jenkins/tests/jenkins-controller-statefulset-test.yaml rename to charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml index 7fa677f36..83e1eb60a 100644 --- a/charts/jenkins/tests/jenkins-controller-statefulset-test.yaml +++ b/charts/jenkins/unittests/jenkins-controller-statefulset-test.yaml @@ -4,8 +4,10 @@ release: namespace: my-namespace templates: - jenkins-controller-statefulset.yaml + - config.yaml tests: - it: default values + template: jenkins-controller-statefulset.yaml asserts: - isKind: of: StatefulSet @@ -194,6 +196,7 @@ tests: secret: secretName: my-release-jenkins - it: test different values + template: jenkins-controller-statefulset.yaml capabilities: apiVersions: - scheduling.k8s.io/v1beta1 @@ -297,6 +300,7 @@ tests: path: spec.updateStrategy.type value: OnDelete - it: configure image tag + template: jenkins-controller-statefulset.yaml set: controller.tag: 2.249.1-slim controller.imagePullPolicy: IfNotPresent @@ -308,6 +312,7 @@ tests: path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent - it: custom image + template: jenkins-controller-statefulset.yaml set: controller: image: registry/image @@ -324,6 +329,7 @@ tests: value: >- -Dcasc.reload.token=$(POD_NAME) -Dio.jenkins.plugins.kubernetes.disableNoDelayProvisioning=true - it: disable helm.sh label + template: jenkins-controller-statefulset.yaml set: renderHelmLabels: false asserts: @@ -335,6 +341,7 @@ tests: app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: jenkins - it: java & jenkins opts with quotes + template: jenkins-controller-statefulset.yaml set: controller: javaOpts: >- @@ -355,6 +362,7 @@ tests: value: >- -Dtest="custom: 'true'" - it: test empty controller.podSecurityContextOverride + template: jenkins-controller-statefulset.yaml set: controller: podSecurityContextOverride: {} @@ -363,6 +371,7 @@ tests: path: spec.template.spec.securityContext value: {} - it: test controller.podSecurityContextOverride + template: jenkins-controller-statefulset.yaml set: controller: podSecurityContextOverride: @@ -378,6 +387,7 @@ tests: supplementalGroups: - 5555 - it: test 2 additional secrets + template: jenkins-controller-statefulset.yaml set: controller.additionalSecrets: - name: something @@ -406,6 +416,7 @@ tests: secret: secretName: my-release-jenkins-additional-secrets - it: test templated environment variables + template: jenkins-controller-statefulset.yaml set: testValue: some-value controller.initContainerEnv: @@ -455,6 +466,7 @@ tests: name: "TEST_ENV_VAR__CONTAINER_TEMPLATED" value: 'some-value' - it: overrides container args + template: jenkins-controller-statefulset.yaml set: controller.overrideArgs: - --httpPort=8080 @@ -466,6 +478,7 @@ tests: - --httpPort=8080 - --requestHeaderSize=32768 - it: render pod annotations + template: jenkins-controller-statefulset.yaml set: controller: podAnnotations: @@ -473,4 +486,4 @@ tests: fixed-annotation: some-fixed-annotation asserts: - matchSnapshot: - path: spec.template.metadata.annotations \ No newline at end of file + path: spec.template.metadata.annotations diff --git a/charts/jenkins/tests/jenkins-controller-svc-test.yaml b/charts/jenkins/unittests/jenkins-controller-svc-test.yaml similarity index 100% rename from charts/jenkins/tests/jenkins-controller-svc-test.yaml rename to charts/jenkins/unittests/jenkins-controller-svc-test.yaml diff --git a/charts/jenkins/tests/rbac-test.yaml b/charts/jenkins/unittests/rbac-test.yaml similarity index 100% rename from charts/jenkins/tests/rbac-test.yaml rename to charts/jenkins/unittests/rbac-test.yaml diff --git a/charts/jenkins/tests/secret-additional-test.yaml b/charts/jenkins/unittests/secret-additional-test.yaml similarity index 100% rename from charts/jenkins/tests/secret-additional-test.yaml rename to charts/jenkins/unittests/secret-additional-test.yaml diff --git a/charts/jenkins/tests/secret-claims-test.yaml b/charts/jenkins/unittests/secret-claims-test.yaml similarity index 100% rename from charts/jenkins/tests/secret-claims-test.yaml rename to charts/jenkins/unittests/secret-claims-test.yaml diff --git a/charts/jenkins/tests/secret-existing-test.yaml b/charts/jenkins/unittests/secret-existing-test.yaml similarity index 92% rename from charts/jenkins/tests/secret-existing-test.yaml rename to charts/jenkins/unittests/secret-existing-test.yaml index 3fca1e3c2..031af3bcd 100644 --- a/charts/jenkins/tests/secret-existing-test.yaml +++ b/charts/jenkins/unittests/secret-existing-test.yaml @@ -4,8 +4,10 @@ release: namespace: my-namespace templates: - jenkins-controller-statefulset.yaml + - config.yaml tests: - it: test additional existing secrets StatefulSet + template: jenkins-controller-statefulset.yaml set: controller.additionalExistingSecrets: - name: secret-name-1 @@ -40,4 +42,4 @@ tests: value: name: secret-name-1-password secret: - secretName: secret-name-1 \ No newline at end of file + secretName: secret-name-1 diff --git a/charts/jenkins/tests/secret-test.yaml b/charts/jenkins/unittests/secret-test.yaml similarity index 100% rename from charts/jenkins/tests/secret-test.yaml rename to charts/jenkins/unittests/secret-test.yaml diff --git a/charts/jenkins/tests/service-account-agent-test.yaml b/charts/jenkins/unittests/service-account-agent-test.yaml similarity index 100% rename from charts/jenkins/tests/service-account-agent-test.yaml rename to charts/jenkins/unittests/service-account-agent-test.yaml diff --git a/charts/jenkins/tests/service-account-test.yaml b/charts/jenkins/unittests/service-account-test.yaml similarity index 100% rename from charts/jenkins/tests/service-account-test.yaml rename to charts/jenkins/unittests/service-account-test.yaml diff --git a/ct.yaml b/ct.yaml index f47a789c6..0bcc28361 100644 --- a/ct.yaml +++ b/ct.yaml @@ -5,4 +5,4 @@ chart-dirs: - charts helm-extra-args: --timeout 600s additional-commands: - - helm unittest --helm3 -f tests/*.yaml {{ .Path }} + - helm unittest --helm3 --strict -f 'unittests/*.yaml' {{ .Path }}