Skip to content

Commit c9f5f73

Browse files
committed
fix(ci): add notifyPush test - WIP
1 parent f07a3ff commit c9f5f73

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

Diff for: .github/tests/test_job_notifyPush.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
apiVersion: batch/v1
3+
kind: Job
4+
metadata:
5+
name: test-nextcloud-notify-push
6+
namespace: nextcloud
7+
spec:
8+
template:
9+
metadata:
10+
name: test-nextcloud-notify-push
11+
spec:
12+
initContainers:
13+
- name: 51-notify-push
14+
image: docker.io/miles170/notify_push
15+
command:
16+
- /bin/sh
17+
- -c
18+
- |
19+
set -e
20+
test_client http://nextcloud.nextcloud.svc.cluster.local:8080 admin changeme
21+
echo "done"
22+
containers:
23+
- name: final
24+
image: curlimages/curl
25+
command:
26+
- /bin/sh
27+
- -c
28+
- |
29+
set -e
30+
echo "All tests run successfull (initContainer in given order)"
31+
restartPolicy: Never

Diff for: .github/workflows/lint-test.yaml

+20-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ jobs:
8585

8686
# test the helm chart with notify push enabled
8787
- name: Notify Push Enabled
88-
helm_args: '--helm-extra-set-args "--values charts/nextcloud/test-values/notify_push.yaml"'
88+
helm_args: '|
89+
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/notify_push.yaml"'
90+
testNotifyPush: true
8991

9092
# test the helm chart with s3 as the primary storage
9193
- name: S3 Enabled as Primary Storage
@@ -96,7 +98,8 @@ jobs:
9698

9799
# test the helm chart with imaginary
98100
- name: Imaginary Enabled
99-
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
101+
helm_args: |
102+
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
100103
test: true
101104

102105
steps:
@@ -165,6 +168,21 @@ jobs:
165168
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
166169
exit $EXIT
167170
171+
- name: Run test for Nextcloud
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+
kubectl apply -f ./.github/tests/test_job_notifyPush.yaml --wait=true && \
178+
sleep 2 && \
179+
kubectl wait --for=condition=Complete --timeout=2m job/test-nextcloud-notify-push || EXIT=1
180+
echo "Here's the logs from the job:"
181+
kubectl logs --ignore-errors --prefix --tail=-1 --all-containers=true -l batch.kubernetes.io/job-name=test-nextcloud-notify-push
182+
echo "Here's the logs from the nextcloud pod:"
183+
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
184+
exit $EXIT
185+
168186
summary:
169187
runs-on: ubuntu-latest-low
170188
needs: [changes, test]

0 commit comments

Comments
 (0)