Improve smoke test (#319)

This commit is contained in:
Daniel Sanche 2020-04-09 17:21:37 -07:00 committed by GitHub
parent 1cf78ea7d8
commit c4daa1c260
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,7 +22,8 @@ jobs:
kubectl get nodes kubectl get nodes
- name: Deploy From Source - name: Deploy From Source
run: | run: |
skaffold run skaffold config set --global local-cluster true
skaffold run --default-repo local
- name: Wait For Pods - name: Wait For Pods
timeout-minutes: 20 timeout-minutes: 20
run: | run: |
@ -42,12 +43,16 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
run: | run: |
set -x set -x
RESULT=" " # start fresh loadgenerator pod
while [[ "$RESULT" != " HTTP/1.1 200 OK" ]]; do kubectl delete pod -l app=loadgenerator
sleep 1 # wait for requests to come in
RESULT=$(kubectl exec deployments/frontend -- sh -c "wget --spider -S "http://frontend" 2>&1 | grep 'HTTP/'") REQUEST_COUNT="0"
echo "front end response: $RESULT" while [[ "$REQUEST_COUNT" -lt "50" ]]; do
sleep 5
REQUEST_COUNT=$(kubectl logs -l app=loadgenerator | grep Aggregated | awk '{print $2}')
done done
if [[ "$RESULT" != " HTTP/1.1 200 OK" ]]; then # ensure there are no errors hitting endpoints
ERROR_COUNT=$(kubectl logs -l app=loadgenerator | grep Aggregated | awk '{print $3}' | sed "s/[(][^)]*[)]//g")
if [[ "$ERROR_COUNT" -gt "0" ]]; then
exit 1 exit 1
fi fi