Skip to content

Commit cd0509b

Browse files
author
Dzmitry Humianiuk
authored
Merge pull request #22 from tmarenko/master
Force finish (stopping) launch added
2 parents 7ae7c4a + bc62769 commit cd0509b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

reportportal_client/service.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,25 @@ def start_launch(self, name, start_time, description=None, tags=None,
128128
logger.debug("start_launch - Stack: %s", self.stack)
129129
return self.launch_id
130130

131-
def finish_launch(self, end_time, status=None):
131+
def _finalize_launch(self, end_time, action, status):
132132
data = {
133133
"end_time": end_time,
134134
"status": status
135135
}
136-
url = uri_join(self.base_url, "launch", self.launch_id, "finish")
136+
url = uri_join(self.base_url, "launch", self.launch_id, action)
137137
r = self.session.put(url=url, json=data)
138138
self.stack.pop()
139-
logger.debug("finish_launch - Stack: %s", self.stack)
139+
logger.debug("%s_launch - Stack: %s", action, self.stack)
140140
return _get_msg(r)
141141

142+
def finish_launch(self, end_time, status=None):
143+
return self._finalize_launch(end_time=end_time, action="finish",
144+
status=status)
145+
146+
def stop_launch(self, end_time, status=None):
147+
return self._finalize_launch(end_time=end_time, action="stop",
148+
status=status)
149+
142150
def start_test_item(self, name, start_time, item_type, description=None,
143151
tags=None):
144152
"""

reportportal_client/service_async.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,15 @@ def finish_launch(self, end_time, status=None):
232232
}
233233
self.queue.put_nowait(("finish_launch", args))
234234

235+
def stop_launch(self, end_time, status=None):
236+
logger.debug("Stop launch queued")
237+
238+
args = {
239+
"end_time": end_time,
240+
"status": status
241+
}
242+
self.queue.put_nowait(("stop_launch", args))
243+
235244
def start_test_item(self, name, start_time, item_type, description=None,
236245
tags=None):
237246
logger.debug("start_test_item queued")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name='reportportal-client',
55
packages=find_packages(),
6-
version='3.0.0',
6+
version='3.1.0',
77
description='Python client for Report Portal',
88
author='Artsiom Tkachou',
99
author_email='[email protected]',

0 commit comments

Comments
 (0)