1
0
Fork 0

Make nimbledroid compliant to UI tests

master
Johan Lorenzo 2019-11-08 14:19:10 +01:00 committed by Sebastian Kaspari
parent de8bc2f8a5
commit e5ead66b12
3 changed files with 29 additions and 39 deletions

View File

@ -34,7 +34,6 @@ display_help() {
}
get_abs_filename() {
# $1 : relative filename
relative_filename="$1"
echo "$(cd "$(dirname "$relative_filename")" && pwd)/$(basename "$relative_filename")"
}

View File

@ -7,7 +7,6 @@ This script talks to the taskcluster secrets service to obtain the
Nimbledroid account key and upload Klar and Focus apk to Nimbledroid for perf analysis.
"""
import taskcluster
import requests
import json
import urllib2
@ -33,18 +32,11 @@ def uploadApk(apk,key):
print json.dumps(response.json(), indent=4)
def uploadNightlyFenixApk(apk_url, key):
apk_data = urllib2.urlopen(apk_url).read()
with open('./fenix_example_nd.apk', 'wb') as f:
f.write(apk_data)
uploadApk({'apk' : open('fenix_example_nd.apk')},key)
apk_path = sys.argv[1]
token_file = sys.argv[2]
with open(token_file) as f:
key = f.read()
# Get JSON data from taskcluster secrets service
secrets = taskcluster.Secrets({
'rootUrl': os.environ.get('TASKCLUSTER_PROXY_URL', 'https://taskcluster.net'),
})
data = secrets.get('project/mobile/fenix/nimbledroid')
# upload the nightly build to Nimbledroid
apk_url = sys.argv[1]
uploadNightlyFenixApk(apk_url, data['secret']['api_key'])
with open(apk_path) as apk_file:
uploadApk({'apk': apk_file}, key)

View File

@ -9,34 +9,33 @@ transforms:
- taskgraph.transforms.task:transforms
kind-dependencies:
- build
- signing
job-defaults:
description: Upload APKs to Nimbledroid for performance measurement and tracking
worker-type: b-android
worker:
docker-image: {in-tree: nimbledroid}
max-run-time: 600
run-on-tasks-for: []
treeherder:
kind: test
tier: 2
platform: android-all/opt
scopes:
- secrets:get:project/mobile/fenix/nimbledroid
run:
using: run-task
use-caches: false
command:
- python
- /builds/worker/checkouts/src/automation/taskcluster/upload_apk_nimbledroid.py
- {artifact-reference: "<build/public/build/armeabi-v7a/geckoNightly/target.apk>"}
jobs:
nightly:
attributes:
nightly: true
treeherder:
symbol: nimbledroid
dependencies:
build: build-nightly
signing: signing-nightly
description: Upload APKs to Nimbledroid for performance measurement and tracking
run:
commands:
- [wget, {artifact-reference: '<signing/public/build/armeabi-v7a/geckoNightly/target.apk>'}, '-O', target.apk]
- [python, automation/taskcluster/upload_apk_nimbledroid.py, target.apk, .nimbledroid_token]
secrets:
- name: project/mobile/fenix/nimbledroid
key: api_key
path: .nimbledroid_token
using: run-commands
use-caches: false
run-on-tasks-for: []
treeherder:
kind: test
platform: android-all/opt
symbol: nimbledroid
tier: 2
worker:
docker-image: {in-tree: nimbledroid}
max-run-time: 600
worker-type: b-android