Skip to content

Commit

Permalink
add end2end test
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Kloeker <[email protected]>
  • Loading branch information
eumel8 committed Dec 2, 2023
1 parent b8ec8de commit 5964957
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/end2end.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# This workflow installs 1 instance of sparrow and
# verify the API output

name: End2End Testing
on:
push:
paths:
- 'chart/**'

jobs:
end2end:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set up K3S
uses: debianmaster/actions-k3s@master
id: k3s
with:
version: 'v1.26.9-k3s1'
- name: Check Cluster
run: |
kubectl get nodes
- name: Check Coredns Deployment
run: |
kubectl -n kube-system rollout status deployment/coredns --timeout=60s
STATUS=$(kubectl -n kube-system get deployment coredns -o jsonpath={.status.readyReplicas})
if [[ $STATUS -ne 1 ]]
then
echo "Deployment coredns not ready"
kubectl -n kube-system get events
exit 1
else
echo "Deployment coredns OK"
fi
- name: Check Metricsserver Deployment
run: |
kubectl -n kube-system rollout status deployment/metrics-server --timeout=60s
STATUS=$(kubectl -n kube-system get deployment metrics-server -o jsonpath={.status.readyReplicas})
if [[ $STATUS -ne 1 ]]
then
echo "Deployment metrics-server not ready"
kubectl -n kube-system get events
exit 1
else
echo "Deployment metrics-server OK"
fi
- name: Setup Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm version
- name: Install Sparrow
run: |
helm upgrade -i sparrow \
--atomic \
--timeout 300s \
--set sparrow.loaderType=file \
chart
- name: Check Pods
run: |
kubectl get pods
- name: Wait for Sparrow
run: |
sleep 60
- name: Check Sparrow
run: |
kubectl create job curl --image=mtr.devops.telekom.de/mcsps/curl:7.65.3 -- curl -f -v -H 'Content-Type: application/json' http://sparrow:8080/v1/metrics/health
kubectl wait --for=condition=complete job/curl
STATUS=$(kubectl get job curl -o jsonpath={.status.succeeded})
if [[ $STATUS -ne 1 ]]
then
echo "Job failed"
kubectl logs -ljob-name=curl
kubectl delete job curl
exit 1
else
echo "Job OK"
kubectl delete job curl
fi

0 comments on commit 5964957

Please sign in to comment.