Added describe pods in case of integration test failures.
This commit is contained in:
@@ -8,39 +8,39 @@ ROOT=$(dirname $0)/../..
|
||||
fn=nodejs-logtest-$(date +%N)
|
||||
|
||||
function cleanup {
|
||||
echo "Cleanup route"
|
||||
echo_log "Cleanup route"
|
||||
var=$(fission route list | grep $fn | awk '{print $1;}')
|
||||
fission route delete --name $var
|
||||
echo "delete logfile"
|
||||
echo_log "delete logfile"
|
||||
rm "/tmp/logfile"
|
||||
}
|
||||
|
||||
# Create a hello world function in nodejs, test it with an http trigger
|
||||
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"
|
||||
fission fn create --name $fn --env nodejs --code log.js
|
||||
trap "fission fn delete --name $fn" EXIT
|
||||
|
||||
echo "Creating route"
|
||||
echo_log "Creating route"
|
||||
fission route create --function $fn --url /$fn --method GET
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Waiting for router to catch up"
|
||||
echo_log "Waiting for router to catch up"
|
||||
sleep 15
|
||||
|
||||
echo "Doing 4 HTTP GETs on the function's route"
|
||||
echo_log "Doing 4 HTTP GETs on the function's route"
|
||||
for i in 1 2 3 4
|
||||
do
|
||||
curl -s http://$FISSION_ROUTER/$fn
|
||||
done
|
||||
|
||||
echo "Grabbing logs, should have 4 calls in logs"
|
||||
echo_log "Grabbing logs, should have 4 calls in logs"
|
||||
|
||||
sleep 15
|
||||
|
||||
@@ -52,15 +52,15 @@ then
|
||||
fission function logs --name $fn --detail > /tmp/logfile
|
||||
fi
|
||||
|
||||
echo "---function logs---"
|
||||
echo_log "---function logs---"
|
||||
cat /tmp/logfile
|
||||
echo "------"
|
||||
echo_log "------"
|
||||
num=$(grep 'log test' /tmp/logfile | wc -l)
|
||||
echo $num logs found
|
||||
echo_log $num logs found
|
||||
|
||||
if [ $num -ne 4 ]
|
||||
then
|
||||
echo "Test Failed: expected 4, found $num logs"
|
||||
echo_log "Test Failed: expected 4, found $num logs"
|
||||
fi
|
||||
|
||||
echo "All done."
|
||||
echo_log "All done."
|
||||
|
||||
Reference in New Issue
Block a user