Skip to content

Commit 43c7354

Browse files
author
jrusnakli
authored
Merge pull request #1 from bitbar/master
merge from master
2 parents e13be09 + b2ec9c1 commit 43c7354

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.41.1
2+
* Possibility to include additional custom params when launching new test run
3+
2.41.0
4+
* Fixed bug with api access using api_key without login/pass
5+
* Fix for download_test_screenshots method to work with version
16
2.40
27
* Fixed download_test_screenshots method to work with 2.39+ version of the Testdroid API
38
2.6.2

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys, os
44

55

6-
version = '2.40'
6+
version = '2.41.1'
77

88
setup(name='testdroid',
99
version=version,

testdroid/__init__.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from optparse import OptionParser
66
from datetime import datetime
77

8-
__version__ = '2.40'
8+
__version__ = '2.41.1'
99

1010
FORMAT = "%(message)s"
1111
logging.basicConfig(format=FORMAT)
@@ -426,7 +426,7 @@ def set_project_framework(self, project_id, frameworkId):
426426

427427
""" Start a test run on a device group
428428
"""
429-
def start_test_run(self, project_id, device_group_id=None, device_model_ids=None, name=None):
429+
def start_test_run(self, project_id, device_group_id=None, device_model_ids=None, name=None, additional_params={}):
430430
me = self.get_me()
431431
payload={} if name is None else {'name':name}
432432
project = self.get_project(project_id)
@@ -461,6 +461,7 @@ def start_test_run(self, project_id, device_group_id=None, device_model_ids=None
461461

462462
# Start run
463463
path = "/users/%s/projects/%s/runs" % ( me['id'], project_id )
464+
payload.update(additional_params)
464465
reply = self.post(path=path, payload=payload)
465466
print "Test run id: %s" % reply['id']
466467
print "Name: %s" % reply['displayName']
@@ -488,13 +489,14 @@ def wait_test_run(self, project_id, test_run_id):
488489
print "Awaiting completion of test run with id %s. Will wait forever polling every %smins." % (test_run_id, Testdroid.polling_interval_mins)
489490
while True:
490491
time.sleep(Testdroid.polling_interval_mins*60)
491-
self.access_token = None #WORKAROUND: access token thinks it's still valid,
492-
# > token valid for another 633.357925177
493-
#whilst this happens:
494-
# > Couldn't establish the state of the test run with id: 72593732. Aborting
495-
# > {u'error_description': u'Invalid access token: b3e62604-9d2a-49dc-88f5-89786ff5a6b6', u'error': u'invalid_token'}
496-
497-
self.get_token() #in case it expired
492+
if not self.api_key:
493+
self.access_token = None #WORKAROUND: access token thinks it's still valid,
494+
# > token valid for another 633.357925177
495+
#whilst this happens:
496+
# > Couldn't establish the state of the test run with id: 72593732. Aborting
497+
# > {u'error_description': u'Invalid access token: b3e62604-9d2a-49dc-88f5-89786ff5a6b6', u'error': u'invalid_token'}
498+
499+
self.get_token() #in case it expired
498500
testRunStatus = self.get_test_run(project_id, test_run_id)
499501
if testRunStatus and testRunStatus.has_key('state'):
500502
if testRunStatus['state'] == "FINISHED":

0 commit comments

Comments
 (0)