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
@@ -15,16 +15,16 @@ PYTHON_BUILDER_IMAGE=gcr.io/fission-ci/python-env-builder:test
fn=python-srcbuild-$(date +%s)
checkFunctionResponse() {
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/$1)
echo "Checking for valid response"
echo $response
echo_log "Checking for valid response"
echo_log $response
echo $response | grep -i "a: 1 b: {c: 3, d: 4}"
}
waitBuild() {
echo "Waiting for builder manager to finish the build"
echo_log "Waiting for builder manager to finish the build"
while true; do
kubectl --namespace default get packages $1 -o jsonpath='{.status.buildstatus}'|grep succeeded
@@ -39,7 +39,7 @@ waitEnvBuilder() {
env=$1
envRV=$(kubectl -n default get environments ${env} -o jsonpath='{.metadata.resourceVersion}')
echo "Waiting for env builder to catch up"
echo_log "Waiting for env builder to catch up"
while true; do
kubectl -n fission-builder get pod -l envName=${env},envResourceVersion=${envRV} \
@@ -51,27 +51,27 @@ waitEnvBuilder() {
}
export -f waitEnvBuilder
echo "Pre-test cleanup"
echo_log "Pre-test cleanup"
fission env delete --name python || true
kubectl --namespace default get packages|grep -v NAME|awk '{print $1}'|xargs -I@ bash -c 'kubectl --namespace default delete packages @' || true
echo "Creating python env"
echo_log "Creating python env"
fission env create --name python --image $PYTHON_RUNTIME_IMAGE --builder $PYTHON_BUILDER_IMAGE
trap "fission env delete --name python" EXIT
timeout 180s bash -c "waitEnvBuilder python"
echo "Creating source pacakage"
echo_log "Creating source pacakage"
zip -jr demo-src-pkg.zip $ROOT/examples/python/sourcepkg/
echo "Creating function " $fn
echo_log "Creating function " $fn
fission fn create --name $fn --env python --src demo-src-pkg.zip --entrypoint "user.main" --buildcmd "./build.sh"
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 3
pkg=$(kubectl --namespace default get functions $fn -o jsonpath='{.spec.package.packageref.name}')
@@ -81,7 +81,7 @@ timeout 60s bash -c "waitBuild $pkg"
checkFunctionResponse $fn
echo "Updating function " $fn
echo_log "Updating function " $fn
fission fn update --name $fn --src demo-src-pkg.zip
trap "fission fn delete --name $fn" EXIT
@@ -95,4 +95,4 @@ checkFunctionResponse $fn
# 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."