Skip to content

Commit 2ecd399

Browse files
author
Alisa Yamanaka
committed
Add function for restarting test runs and device runs
1 parent b3df0f2 commit 2ecd399

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

testdroid/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,14 @@ def print_project_test_runs(self, project_id, limit=0):
588588
def get_test_run(self, project_id, test_run_id):
589589
return self.get("me/projects/%s/runs/%s" % (project_id, test_run_id))
590590

591+
""" Re-run an already-existing test run. Specify individual device run IDs to only re-run those devices.
592+
"""
593+
def retry_test_run(self, project_id, test_run_id, device_run_ids=[]):
594+
endpoint = "me/projects/%s/runs/%s/retry" % (project_id, test_run_id)
595+
if device_run_ids:
596+
endpoint += "?deviceRunIds[]=" + "&deviceRunIds[]=".join(str(device_id) for device_id in device_run_ids)
597+
return self.post(endpoint)
598+
591599
"""Abort a test run
592600
"""
593601
def abort_test_run(self, project_id, test_run_id):

0 commit comments

Comments
 (0)