Skip to content

Commit e87e507

Browse files
committed
fix(ci): add notifyPush test - WIP
Signed-off-by: WrenIX <dev.github@wrenix.eu>
1 parent 0d45741 commit e87e507

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.github/workflows/lint-test.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@ jobs:
8383
- name: Horizontal Pod Autoscaling Enabled
8484
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/hpa.yaml"'
8585

86-
# test the helm chart with notify push enabled
87-
- name: Notify Push Enabled
88-
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/notify_push.yaml"'
89-
9086
# test the helm chart with s3 as the primary storage
9187
- name: S3 Enabled as Primary Storage
9288
# we need to skip the clean up so we can test adding a file
@@ -96,9 +92,16 @@ jobs:
9692

9793
# test the helm chart with imaginary
9894
- name: Imaginary Enabled
99-
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
95+
helm_args: |
96+
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
10097
test: true
10198

99+
# test the helm chart with notify push enabled
100+
- name: Notify Push Enabled
101+
helm_args: |
102+
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/notify_push.yaml"
103+
testNotifyPush: true
104+
102105
steps:
103106
- name: Checkout
104107
uses: actions/checkout@v6
@@ -165,6 +168,20 @@ jobs:
165168
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
166169
exit $EXIT
167170
171+
- name: Run test for Notify Push
172+
if: matrix.test_cases.testNotifyPush
173+
# applies a kubernetes job that uploads a file and then checks log of finished pod
174+
run: |
175+
EXIT=0
176+
kubectl config set-context --current --namespace=nextcloud
177+
POD=$(kubectl get pods -o name --selector "app.kubernetes.io/component=app")
178+
(kubectl wait --for=condition=Ready --timeout=2m "${POD}" && sleep 60) || EXIT=1
179+
kubectl exec --stdin "${POD}" -c nextcloud -- sh -c '
180+
chsh -s /bin/sh www-data
181+
su -l www-data -c "/var/www/html/occ notify_push:self-test"
182+
' || EXIT=1
183+
exit $EXIT
184+
168185
summary:
169186
runs-on: ubuntu-latest-low
170187
needs: [changes, test]

charts/nextcloud/test-values/notify_push.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
fullnameOverride: nextcloud
2+
3+
nextcloud:
4+
host: "nextcloud.nextcloud.svc.cluster.local"
5+
16
redis:
27
enabled: true
38

@@ -8,3 +13,4 @@ mariadb:
813

914
notifyPush:
1015
enabled: true
16+
autoSetup: true

0 commit comments

Comments
 (0)