From a6c3f91fcb609208a66292fd565abf8141442be7 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Sun, 11 Aug 2024 21:46:22 +0200 Subject: [PATCH] fix(ci): use default chart-testing logic for different testcases Signed-off-by: WrenIX --- .github/workflows/lint-test.yaml | 35 ++----------- .../nextcloud/ci/ct-all-enabled-values.yaml | 19 ------- charts/nextcloud/ci/ct-hpa-values.yaml | 5 ++ charts/nextcloud/ci/ct-nginx-values.yaml | 5 ++ charts/nextcloud/ci/ct-postgresql-values.yaml | 12 +++++ .../nextcloud/ci/ct-s3-as-primary-values.yaml | 22 ++++++++ charts/nextcloud/ci/ct-specials-values.yaml | 51 ------------------- 7 files changed, 48 insertions(+), 101 deletions(-) delete mode 100644 charts/nextcloud/ci/ct-all-enabled-values.yaml create mode 100644 charts/nextcloud/ci/ct-hpa-values.yaml create mode 100644 charts/nextcloud/ci/ct-nginx-values.yaml create mode 100644 charts/nextcloud/ci/ct-postgresql-values.yaml create mode 100644 charts/nextcloud/ci/ct-s3-as-primary-values.yaml delete mode 100644 charts/nextcloud/ci/ct-specials-values.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 4c673cbc..0b5dac85 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -61,33 +61,6 @@ jobs: needs: [changes, lint] # only run this job if there are helm chart file changes if: needs.changes.outputs.src != 'false' - strategy: - # continue with all the other jobs even if one fails - fail-fast: false - matrix: - # each item in this list is a job with an isolated test VM - test_cases: - # test the plain helm chart with nothing changed - - name: 'Default - no custom values' - - # test the helm chart with postgresql subchart enabled - - name: PostgreSQL Enabled - helm_args: '--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing12345"' - - # test the helm chart with nginx container enabled - - name: Nginx Enabled - helm_args: '--helm-extra-set-args "--set=image.flavor=fpm --set=nginx.enabled=true"' - - # test the helm chart with horizontal pod autoscaling enabled - - name: Horizontal Pod Autoscaling Enabled - helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' - - # test the helm chart with s3 as the primary storage - - name: S3 Enabled as Primary Storage - # we need to skip the clean up so we can test adding a file - helm_args: | - --namespace nextcloud --skip-clean-up --helm-extra-set-args "--set=fullnameOverride=nextcloud --set=nextcloud.objectStore.s3.enabled=true --set=nextcloud.objectStore.s3.accessKey=nextcloud --set=nextcloud.objectStore.s3.secretKey=rootpass123 --set=nextcloud.objectStore.s3.host=minio.nextcloud.svc.cluster.local --set=nextcloud.objectStore.s3.port=9000 --set=nextcloud.objectStore.s3.ssl=false --set=nextcloud.objectStore.s3.bucket=nextcloud --set=nextcloud.objectStore.s3.usePathStyle=true --set=image.flavor=fpm --set=nginx.enabled=true --set=nextcloud.host=nextcloud --set=nextcloud.trustedDomains[0]='*'" - steps: - name: Checkout uses: actions/checkout@v4 @@ -119,7 +92,7 @@ jobs: if: steps.list-changed.outputs.changed == 'true' - name: Install MinIO for testing S3 as Primary Storage - if: matrix.test_cases.name == 'S3 Enabled as Primary Storage' + # only used during ct-s3-as-primary-values.yaml # installs minio community helm chart here: # https://github.com/minio/minio/tree/master/helm/minio run: | @@ -133,13 +106,13 @@ jobs: --values .github/tests/minio_test_values.yaml \ minio/minio - - name: Run chart-testing (install ${{ matrix.test_cases.name }}) + - name: Run chart-testing (install all charts/nextcloud/ci/ct-*-values.yaml) id: install if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }} + run: ct install --target-branch ${{ github.event.repository.default_branch }} - name: Try adding a file to Nextcloud - if: matrix.test_cases.name == 'S3 Enabled as Primary Storage' + # only used during ct-s3-as-primary-values.yaml # applies a kubernetes job that uploads a file and then checks log of finished pod run: | kubectl config set-context --current --namespace=nextcloud && \ diff --git a/charts/nextcloud/ci/ct-all-enabled-values.yaml b/charts/nextcloud/ci/ct-all-enabled-values.yaml deleted file mode 100644 index 13133432..00000000 --- a/charts/nextcloud/ci/ct-all-enabled-values.yaml +++ /dev/null @@ -1,19 +0,0 @@ -metrics: - enabled: true - -nextcloud: - configs: - my.config.php: |- -