From 1ecbfefb59c3887038afcb46afb3aeb6fc94b367 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Sat, 22 Nov 2014 19:32:28 +1100 Subject: Improve tesmunk script --- android/test/upload_testmunk.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'android') diff --git a/android/test/upload_testmunk.sh b/android/test/upload_testmunk.sh index e32081c766..15c6530d83 100755 --- a/android/test/upload_testmunk.sh +++ b/android/test/upload_testmunk.sh @@ -3,20 +3,25 @@ set -e set -o pipefail -APP_NAME = "Mapbox" -APK_PATH = $1 +EMAIL="leith@mapbox.com" +APP_NAME="Mapbox" +APK_PATH=$1 echo "submitting testrun to testmunk" -echo "uploading features" -echo +echo "uploading features..." zip -r features.zip features/ -curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@features.zip' 'https://${TESTMUNK_KEY}@api.testmunk.com/apps/${APP_NAME}/testcases' | jq '.' +RESPONSE=$(curl -f -H "Accept: application/vnd.testmunk.v1+json" -F "file=@features.zip" "https://${TESTMUNK_KEY}@api.testmunk.com/apps/${APP_NAME}/testcases") -echo "uploading apk" -echo +echo "uploading apk..." cd `dirname ${APK_PATH}` -curl -H 'Accept: application/vnd.testmunk.v1+json' -F 'file=@`basename ${APK_PATH}`' -F 'email=leith@mapbox.com' -F 'autoStart=true' -F 'public=true' 'https://${TESTMUNK_KEY}@api.testmunk.com/apps/${APP_NAME}/testruns' | jq '.' +RESPONSE=$(curl -f -H "Accept: application/vnd.testmunk.v1+json" -F "file=@`basename ${APK_PATH}`" -F "email=${EMAIL}" -F "autoStart=true" -F "public=true" "https://${TESTMUNK_KEY}@api.testmunk.com/apps/${APP_NAME}/testruns") + +TESTRUN_ID=$(echo "${RESPONSE}" | jq -r '.id') +TESTRUN_NAME=$(echo "${RESPONSE}" | jq -r '.name') + +echo "successully uploaded to Testmunk as '${TESTRUN_NAME}'" +echo "public link to test results: https://www.testmunk.com/testrun/${TESTRUN_ID}" cd - -- cgit v1.2.1