From d62eee3f621ca06a01557592344cc62d6a8da181 Mon Sep 17 00:00:00 2001 From: Illia Bershadskyi Date: Fri, 24 Feb 2017 17:13:05 +0100 Subject: [PATCH 1/5] Fixed bug with api access using api_key without login/pass --- testdroid/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testdroid/__init__.py b/testdroid/__init__.py index b8f1423..91b88dd 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -488,13 +488,14 @@ def wait_test_run(self, project_id, test_run_id): print "Awaiting completion of test run with id %s. Will wait forever polling every %smins." % (test_run_id, Testdroid.polling_interval_mins) while True: time.sleep(Testdroid.polling_interval_mins*60) - self.access_token = None #WORKAROUND: access token thinks it's still valid, - # > token valid for another 633.357925177 - #whilst this happens: - # > Couldn't establish the state of the test run with id: 72593732. Aborting - # > {u'error_description': u'Invalid access token: b3e62604-9d2a-49dc-88f5-89786ff5a6b6', u'error': u'invalid_token'} - - self.get_token() #in case it expired + if not self.api_key: + self.access_token = None #WORKAROUND: access token thinks it's still valid, + # > token valid for another 633.357925177 + #whilst this happens: + # > Couldn't establish the state of the test run with id: 72593732. Aborting + # > {u'error_description': u'Invalid access token: b3e62604-9d2a-49dc-88f5-89786ff5a6b6', u'error': u'invalid_token'} + + self.get_token() #in case it expired testRunStatus = self.get_test_run(project_id, test_run_id) if testRunStatus and testRunStatus.has_key('state'): if testRunStatus['state'] == "FINISHED": From e13be0928fc1427381f872650015dc155dac2ed6 Mon Sep 17 00:00:00 2001 From: john rusnak Date: Tue, 18 Jul 2017 16:11:23 -0700 Subject: [PATCH 2/5] Fix to download screenshots regardless of sucess/failure --- testdroid/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testdroid/__init__.py b/testdroid/__init__.py index b156dd2..34ddea2 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -606,7 +606,7 @@ def download_test_screenshots(self, project_id, test_run_id): logger.info(""); for device_run in device_runs['data']: - if device_run['state'] == "SUCCEEDED": + if device_run['state'] in ["SUCCEEDED", "FAILED", "ABORTED", "WARNING", "TIMEOUT"]: directory = "%s-%s/%d-%s/screenshots" % (test_run['id'], test_run['displayName'], device_run['id'], device_run['device']['displayName']) screenshots = self.get_device_run_screenshots_list(project_id, test_run_id, device_run['id']) no_screenshots = True @@ -638,7 +638,7 @@ def download_test_screenshots(self, project_id, test_run_id): if no_screenshots: logger.info("Device %s has no screenshots - skipping" % device_run['device']['displayName']) else: - logger.info("Device %s has failed or has not finished - skipping" % device_run['device']['displayName']) + logger.info("Device %s has errored or has not finished - skipping" % device_run['device']['displayName']) def get_parser(self): class MyParser(OptionParser): From 5cf86071a8ad1dd6b31ef80550870e100de6664c Mon Sep 17 00:00:00 2001 From: Sakari Rautiainen Date: Thu, 20 Jul 2017 12:32:36 -0700 Subject: [PATCH 3/5] Added patch version --- testdroid/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testdroid/__init__.py b/testdroid/__init__.py index ffd1f79..c38f613 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -5,7 +5,7 @@ from optparse import OptionParser from datetime import datetime -__version__ = '2.40' +__version__ = '2.40.0' FORMAT = "%(message)s" logging.basicConfig(format=FORMAT) From 93797eafc38064669a7421a0bf5296e6c39e8a4f Mon Sep 17 00:00:00 2001 From: Jenkins Date: Thu, 20 Jul 2017 21:45:42 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Bump=20version:=202.40.0=20=E2=86=92=202.41?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- testdroid/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e87e8a0..c55c0e7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import sys, os -version = '2.40.0' +version = '2.41.0' setup(name='testdroid', version=version, diff --git a/testdroid/__init__.py b/testdroid/__init__.py index c38f613..b0926fc 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -5,7 +5,7 @@ from optparse import OptionParser from datetime import datetime -__version__ = '2.40.0' +__version__ = '2.41.0' FORMAT = "%(message)s" logging.basicConfig(format=FORMAT) From 042f05f3c9fec037a4e58a6f23b091b5a0217cad Mon Sep 17 00:00:00 2001 From: Sakari Rautiainen Date: Thu, 20 Jul 2017 12:47:48 -0700 Subject: [PATCH 5/5] 2.41.0 comments --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index aa21b64..d2aa178 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2.41.0 + * Fixed bug with api access using api_key without login/pass + * Fix for download_test_screenshots method to work with version 2.40 * Fixed download_test_screenshots method to work with 2.39+ version of the Testdroid API 2.6.2