Skip to content

Commit

Permalink
nextcloud upload test: print HTTP return code for pod...
Browse files Browse the repository at this point in the history
- reduce sleep before waiting on job to complete

- use --tail=-1 -f with kubectl logs to get whole output

- nicely print success after job done

Signed-off-by: jessebot <[email protected]>
  • Loading branch information
jessebot committed Jul 24, 2024
1 parent e5407e0 commit cb386cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/test_upload_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ spec:
- |
echo "testing123" > test_upload.txt && \
curl \
-w "%{http_code}" \
-u nextcloud:changeme \
-T test_upload.txt \
"http://nextcloud.nextcloud.svc.cluster.local:8080/nextcloud/remote.php/dav/files/nextcloud/test_upload.txt" && \
echo "success"
echo "\nSuccessfully uploaded a file, test_upload.txt, to Nextcloud."
restartPolicy: Never
6 changes: 3 additions & 3 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ jobs:
# applies a kubernetes job that uploads a file and then checks log of finished pod
run: |
kubectl apply -f ./.github/test_upload_job.yaml --wait=true && \
sleep 15 && \
export POD=`kubectl get pods -o custom-columns=NAME:.metadata.name --no-headers` && \
kubectl logs $POD
sleep 2 && \
kubectl wait --for=condition=Complete --timeout=2m job/create-nextcloud-file && \
kubectl logs -l batch.kubernetes.io/job-name="create-nextcloud-file" --tail=-1 -f
summary:
runs-on: ubuntu-latest-low
Expand Down

0 comments on commit cb386cc

Please sign in to comment.