From 5f6d320e80c7841045c8d25ab595f8714038d0e7 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 22 Feb 2016 10:14:18 -0800 Subject: [PATCH] submit2xtc.sh: reflect changes in new android agent --- http-api/build-test.sh | 12 ++++++++++++ machines/SM-N910F_4.4.4.conf | 5 +++++ performancebot/utils/submit2xtc.sh | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100755 http-api/build-test.sh create mode 100644 machines/SM-N910F_4.4.4.conf diff --git a/http-api/build-test.sh b/http-api/build-test.sh new file mode 100755 index 00000000..1879eb74 --- /dev/null +++ b/http-api/build-test.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -e + +# FIXME: get credentials `benchmarkerPostgres` and `httpAPITokens` + +env GOOS=linux GOARCH=amd64 go build -o http-api *.go +docker build -t http-api-test . +rm http-api + +docker tag -f http-api-test 633007691302.dkr.ecr.us-east-1.amazonaws.com/http-api-test:latest +docker push 633007691302.dkr.ecr.us-east-1.amazonaws.com/http-api-test:latest diff --git a/machines/SM-N910F_4.4.4.conf b/machines/SM-N910F_4.4.4.conf new file mode 100644 index 00000000..ed92ca4b --- /dev/null +++ b/machines/SM-N910F_4.4.4.conf @@ -0,0 +1,5 @@ +{ + "Name": "SM-N910F_4.4.4", + "DefaultTimeout": 120, + "architecture": "armeabi-v7a", +} diff --git a/performancebot/utils/submit2xtc.sh b/performancebot/utils/submit2xtc.sh index e4f6b961..0ac0c172 100644 --- a/performancebot/utils/submit2xtc.sh +++ b/performancebot/utils/submit2xtc.sh @@ -28,6 +28,21 @@ if [ ! -f $PARAMSJSON ]; then exit 3 fi +if [ ! -f ./jq ]; then + wget -O ./jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-osx-amd64 + chmod +x ./jq +fi + +function checkjsonfield() +{ + (cat "$PARAMSJSON" | ./jq -e '.'$1 > /dev/null) || (echo "file $PARAMSJSON must contain field $1" && exit 4) +} + +# check if the json file has the required fields +checkjsonfield 'githubAPIKey' +checkjsonfield 'httpAPITokens' +checkjsonfield 'runSetId' + submitjob () { DEVICENAME=$1 DEVICEID=$2 @@ -49,6 +64,11 @@ submitjob () { | grep runSetId | grep -o -E '\d+') echo "runSetId: $RUNSETID" + # insert new runSetId into JSON file + PARAMTMP=$(mktemp /tmp/param_template.json.XXXXXX) + mv "$PARAMSJSON" "$PARAMTMP" + cat "$PARAMTMP" | ./jq 'to_entries | map(if .key == "runSetId" then . + {"value":'$RUNSETID'} else . end) | from_entries ' > $PARAMSJSON + rm -f "$PARAMTMP" # build app + uitests (cd AndroidAgent && $XBUILDANDROID /p:Configuration=Release /target:SignAndroidPackage ) @@ -90,6 +110,7 @@ xbuild /p:Configuration=Release /target:compare OLDIFS=$IFS IFS=',' +# for i in "SM-N910F_4.4.4",df355e99,"--test-chunk","1"; do for i in "Nexus-5_4.4.4",aba2bb7e,"--test-chunk","1" "Nexus-5_4.4.4-f36cc9c33f1a",f36cc9c33f1a,"","2"; do set $i DEVICENAME=$1