Skip to content

Commit cf98126

Browse files
authored
Merge branch 'master' into adding-parameters
2 parents 348c2cc + cd0509b commit cf98126

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
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, parameters=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, parameters=None):
237246
logger.debug("start_test_item queued")

0 commit comments

Comments
 (0)