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
+13 -13
View File
@@ -5,51 +5,51 @@ set -euo pipefail
ROOT=$(dirname $0)/../..
# Create a hello world function in nodejs, test it with an http trigger
echo "NewDeploy ExecutorType: Pre-test cleanup"
echo_log "NewDeploy ExecutorType: 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 --mincpu 20 --maxcpu 100 --minmemory 128 --maxmemory 256
trap "fission env delete --name nodejs" EXIT
# TODO Imporve test code by reusing common blocks
echo "Creating function, testing for cold start with MinScale 0"
echo_log "Creating function, testing for cold start with MinScale 0"
fn0=nodejs-hello-$(date +%N)
fission fn create --name $fn0 --env nodejs --code $ROOT/examples/nodejs/hello.js --minscale 0 --maxscale 4 --executortype newdeploy
trap "fission fn delete --name $fn0" EXIT
echo "Creating route"
echo_log "Creating route"
fission route create --function $fn0 --url /$fn0 --method GET
echo "Waiting for router & newdeploy deployment creation"
echo_log "Waiting for router & newdeploy deployment creation"
sleep 5
echo "Doing an HTTP GET on the function's route"
echo_log "Doing an HTTP GET on the function's route"
response0=$(curl http://$FISSION_ROUTER/$fn0)
echo "Checking for valid response"
echo_log "Checking for valid response"
echo $response0 | grep -i hello
echo "Creating function, testing for warm start with MinScale 1"
echo_log "Creating function, testing for warm start with MinScale 1"
fn1=nodejs-hello-$(date +%N)
fission fn create --name $fn1 --env nodejs --code $ROOT/examples/nodejs/hello.js --minscale 1 --maxscale 4 --executortype newdeploy
trap "fission fn delete --name $fn1" EXIT
echo "Creating route"
echo_log "Creating route"
fission route create --function $fn1 --url /$fn1 --method GET
echo "Waiting for router & newdeploy deployment creation"
echo_log "Waiting for router & newdeploy deployment creation"
sleep 5
echo "Doing an HTTP GET on the function's route"
echo_log "Doing an HTTP GET on the function's route"
response1=$(curl http://$FISSION_ROUTER/$fn0)
echo "Checking for valid response"
echo_log "Checking for valid response"
echo $response1 | grep -i hello
# crappy cleanup, improve this later
kubectl get httptrigger -o name | tail -1 | cut -f2 -d'/' | xargs kubectl delete httptrigger
echo "NewDeploy ExecutorType: All done."
echo_log "NewDeploy ExecutorType: All done."