Skip to content

Commit

Permalink
fix(ci): add notifyPush test - WIP
Browse files Browse the repository at this point in the history
Signed-off-by: WrenIX <[email protected]>
  • Loading branch information
wrenix committed Jan 24, 2025
1 parent f07a3ff commit cf432ce
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/tests/test_job_notifyPush.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: test-nextcloud-notify-push
namespace: nextcloud
spec:
template:
metadata:
name: test-nextcloud-notify-push
spec:
initContainers:
- name: 51-notify-push
image: docker.io/miles170/notify_push
command:
- /bin/sh
- -c
- |
set -e
test_client http://nextcloud.nextcloud.svc.cluster.local:8080 admin changeme
echo "done"
containers:
- name: final
image: curlimages/curl
command:
- /bin/sh
- -c
- |
set -e
echo "All tests run successfull (initContainer in given order)"
restartPolicy: Never
22 changes: 20 additions & 2 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ jobs:

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

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

# test the helm chart with imaginary
- name: Imaginary Enabled
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
helm_args: |
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
test: true

steps:
Expand Down Expand Up @@ -165,6 +168,21 @@ jobs:
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
exit $EXIT
- name: Run test for Nextcloud
if: matrix.test_cases.testNotifyPush
# applies a kubernetes job that uploads a file and then checks log of finished pod
run: |
EXIT=0
kubectl config set-context --current --namespace=nextcloud && \
kubectl apply -f ./.github/tests/test_job_notifyPush.yaml --wait=true && \
sleep 2 && \
kubectl wait --for=condition=Complete --timeout=2m job/test-nextcloud-notify-push || EXIT=1
echo "Here's the logs from the job:"
kubectl logs --ignore-errors --prefix --tail=-1 --all-containers=true -l batch.kubernetes.io/job-name=test-nextcloud-notify-push
echo "Here's the logs from the nextcloud pod:"
kubectl logs --ignore-errors --prefix -l app.kubernetes.io/name=nextcloud
exit $EXIT
summary:
runs-on: ubuntu-latest-low
needs: [changes, test]
Expand Down

0 comments on commit cf432ce

Please sign in to comment.