Added describe pods in case of integration test failures.

This commit is contained in:
smruthi2187
2018-02-08 13:58:44 -08:00
parent bce45d6d25
commit a98370ca63
12 changed files with 163 additions and 139 deletions
+12 -12
View File
@@ -10,28 +10,28 @@ fn=nodejs-hello-$(date +%s)
# Update it and check it's output, the output should be
# different from the previous one.
echo "Pre-test cleanup"
echo_log "Pre-test cleanup"
fission env delete --name nodejs || true
echo "Creating nodejs env"
echo_log "Creating nodejs env"
fission env create --name nodejs --image fission/node-env
trap "fission env delete --name nodejs" EXIT
echo "Creating function"
echo_log "Creating function"
echo 'module.exports = function(context, callback) { callback(200, "foo!\n"); }' > foo.js
fission fn create --name $fn --env nodejs --code foo.js
trap "fission fn delete --name $fn" EXIT
echo "Creating route"
echo_log "Creating route"
fission route create --function $fn --url /$fn --method GET
echo "Waiting for router to catch up"
echo_log "Waiting for router to catch up"
sleep 10
echo "Doing an HTTP GET on the function's route"
echo_log "Doing an HTTP GET on the function's route"
response=$(curl http://$FISSION_ROUTER/$fn)
echo "Checking for valid response"
echo_log "Checking for valid response"
echo $response | grep -i foo
# Running a background process to keep access the
@@ -40,18 +40,18 @@ echo $response | grep -i foo
( watch -n1 curl http://$FISSION_ROUTER/$fn ) > /dev/null 2>&1 &
pid=$!
echo "Updating function"
echo_log "Updating function"
echo 'module.exports = function(context, callback) { callback(200, "bar!\n"); }' > bar.js
fission fn update --name $fn --code bar.js
trap "fission fn delete --name $fn" EXIT
echo "Waiting for router to update cache"
echo_log "Waiting for router to update cache"
sleep 10
echo "Doing an HTTP GET on the function's route"
echo_log "Doing an HTTP GET on the function's route"
response=$(curl http://$FISSION_ROUTER/$fn)
echo "Checking for valid response again"
echo_log "Checking for valid response again"
echo $response | grep -i bar
kill -15 $pid
@@ -59,4 +59,4 @@ kill -15 $pid
# crappy cleanup, improve this later
kubectl get httptrigger -o name | tail -1 | cut -f2 -d'/' | xargs kubectl delete httptrigger
echo "All done."
echo_log "All done."