Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): use default chart-testing logic for different testcases #526

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 4 additions & 31 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: |
Expand All @@ -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 && \
Expand Down
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 5.5.2
version: 5.5.3
appVersion: 29.0.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
Empty file.
5 changes: 5 additions & 0 deletions charts/nextcloud/ci/ct-hpa-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hpa:
enabled: true
minPods: 2
maxPods: 3
targetCPUUtilizationPercentage: 75
5 changes: 5 additions & 0 deletions charts/nextcloud/ci/ct-nginx-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
image:
flavor: fpm

nginx:
enabled: true
12 changes: 12 additions & 0 deletions charts/nextcloud/ci/ct-postgresql-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
postgresql:
enabled: true
global:
postgresql:
auth:
password: testing123456
internalDatabase:
enabled: false
externalDatabase:
enabled: true
type: postgresql
password: testing123456
22 changes: 22 additions & 0 deletions charts/nextcloud/ci/ct-s3-as-primary-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
fullnameOverride: nextcloud

nextcloud:
trustedDomains:
- '*'
host: "nextcloud"
objectStore:
s3:
enabled: true
accessKey: nextcloud
secretKey: rootpass123
host: minio.nextcloud.svc.cluster.local
port: 9000
ssl: false
bucket: nextcloud
usePathStyle: true

image:
flavor: fpm

nginx:
enabled: true
Loading