From 8cbc9a8b9c0263f07f9dc81fe08a3591b2f96bb2 Mon Sep 17 00:00:00 2001 From: Jarno Tuovinen Date: Fri, 19 Dec 2014 14:10:29 +0200 Subject: [PATCH 1/5] Add build instructions to README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index dbc703e..82d4dd0 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,15 @@ Example: >>> testdroid.get_test_run(1233, 12345) {u'displayName': u'Test Run 1', u'logZipState': u'BLANK', u'screenshotZipState': u'BLANK', u'projectId': 12340, u'number': 1, u'successRatio': 0.814815, u'createTime': 1393595647000, u'executionRatio': 1.0, u'state': u'FINISHED', u'startedByDisplayName': u'John Doe', u'id': 10} ``` + ++Developing and testing +---------------------- + +Set up sandbox + +`virtualenv myenv && source myenv/bin/activate` + +Build example + +`python setup.py clean && python setup.py sdist && pip install -U dist/testdroid-0.1.2dev.tar.gz && bin/testdroid-api-client me` + From 68cc9077542b21d83ab049cf90e0489635b6be76 Mon Sep 17 00:00:00 2001 From: Jarno Tuovinen Date: Fri, 19 Dec 2014 14:12:04 +0200 Subject: [PATCH 2/5] Bump version from 0.1.4 to 0.1.5.dev --- setup.py | 2 +- testdroid/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 79e95b9..26f2545 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages import sys, os -version = '0.1.4' +version = '0.1.5.dev' setup(name='testdroid', version=version, diff --git a/testdroid/__init__.py b/testdroid/__init__.py index fb3337b..aec5f5c 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -7,7 +7,7 @@ from datetime import datetime FORMAT = '%(message)s' -__version__ = '0.1.3' +__version__ = '0.1.5.dev' logging.basicConfig(format=FORMAT) logger = logging.getLogger('testdroid') logger.setLevel(logging.INFO) From 9bc7045501e7172bc2274deb81bde3236dc4e065 Mon Sep 17 00:00:00 2001 From: Remek Zajac Date: Tue, 16 Dec 2014 14:53:46 +0000 Subject: [PATCH 3/5] Adding the ability to change the project config (so that the client can set the project limitations, like narrow down the scope of tests to a specific package) --- testdroid/__init__.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/testdroid/__init__.py b/testdroid/__init__.py index aec5f5c..cb91ca7 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -317,6 +317,18 @@ def set_project_parameters(self, project_id, parameters): path = "/users/%s/projects/%s/config/parameters" % ( me['id'], project_id ) reply = self.post(path=path, payload=parameters) + + """ Set project config according to http://docs.testdroid.com/_pages/client.html#project-config + """ + def set_project_config(self, project_id, payload): + #set the project config to reflect the given json payload + #e.g.: {'usedDeviceGroupId': 1234} + if isinstance(payload, str): + payload=json.loads(payload) + me = self.get_me() + path = "/users/%s/projects/%s/config" % ( me['id'], project_id ) + return self.post(path=path, payload=payload) + """ Start a test run on a device group """ def start_test_run(self, project_id, device_group_id=None, device_model_ids=None): @@ -337,8 +349,8 @@ def start_test_run(self, project_id, device_group_id=None, device_model_ids=None print "Device group %s not found" % device_group_id sys.exit(1) # Update device group - path = "/users/%s/projects/%s/config" % ( me['id'], project_id ) - reply = self.post(path=path, payload={'usedDeviceGroupId': device_group_id}) + + reply = self.set_project_config(project_id=project_id, payload={'usedDeviceGroupId': device_group_id}) if int(reply['usedDeviceGroupId']) != int(device_group_id): print "Unable to set used device group to %s for project %s" % (device_group_id, project_id) sys.exit(1) @@ -524,6 +536,10 @@ def format_epilog(self, formatter): upload-application Upload application to project upload-test Upload test file to project upload-data Upload additional data file to project + set-project-config Change the project config parameters as facilitated by the API: + http://docs.testdroid.com/_pages/client.html#project-config + e.g.: + ./testdroid-api-client set-project-config 1234 '{"limitationType":"CLASS", "limitationValue":"com.foo.test.VerifyFoo"}' start-test-run Start a test run start-wait-download-test-run Start a test run, await completion (polling) and @@ -535,7 +551,7 @@ def format_epilog(self, formatter): download-test-run Download test run data. Data will be downloaded to current directory in a structure: [test-run-id]/[device-run-id]-[device-name]/files... - download-test-screenshots + download-test-screenshots Download test run data. Data will be downloaded to current directory in a structure: [test-run-id]/[device-run-id]-[device-name]/files... @@ -564,6 +580,7 @@ def get_commands(self): "upload-application": self.upload_application_file, "upload-test": self.upload_test_file, "upload-data": self.upload_data_file, + "set-project-config": self.set_project_config, "start-test-run": self.start_test_run, "start-wait-download-test-run":self.start_wait_download_test_run, "wait-test-run":self.wait_test_run, From 077910d89cab0e995be035f8bab90991ced5cd50 Mon Sep 17 00:00:00 2001 From: Jarno Tuovinen Date: Fri, 19 Dec 2014 14:41:08 +0200 Subject: [PATCH 4/5] Clean epilog --- testdroid/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testdroid/__init__.py b/testdroid/__init__.py index cb91ca7..2d5ffef 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -536,7 +536,8 @@ def format_epilog(self, formatter): upload-application Upload application to project upload-test Upload test file to project upload-data Upload additional data file to project - set-project-config Change the project config parameters as facilitated by the API: + set-project-config + Change the project config parameters as facilitated by the API: http://docs.testdroid.com/_pages/client.html#project-config e.g.: ./testdroid-api-client set-project-config 1234 '{"limitationType":"CLASS", "limitationValue":"com.foo.test.VerifyFoo"}' @@ -548,7 +549,8 @@ def format_epilog(self, formatter): test-runs Get test runs for a project test-run Get test run details device-runs Get device runs for a test run - download-test-run Download test run data. Data will be downloaded to + download-test-run + Download test run data. Data will be downloaded to current directory in a structure: [test-run-id]/[device-run-id]-[device-name]/files... download-test-screenshots From 8380f5eb2bd7f24b0a6e579e65fb799db1889c59 Mon Sep 17 00:00:00 2001 From: Jarno Tuovinen Date: Fri, 19 Dec 2014 14:59:00 +0200 Subject: [PATCH 5/5] Bump version to 0.1.5 from 0.1.5.dev --- setup.py | 2 +- testdroid/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 26f2545..f726a6a 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages import sys, os -version = '0.1.5.dev' +version = '0.1.5' setup(name='testdroid', version=version, diff --git a/testdroid/__init__.py b/testdroid/__init__.py index 2d5ffef..ddd4ee6 100755 --- a/testdroid/__init__.py +++ b/testdroid/__init__.py @@ -7,7 +7,7 @@ from datetime import datetime FORMAT = '%(message)s' -__version__ = '0.1.5.dev' +__version__ = '0.1.5' logging.basicConfig(format=FORMAT) logger = logging.getLogger('testdroid') logger.setLevel(logging.INFO)