diff --git a/reportportal_client/service.py b/reportportal_client/service.py index 6004c646..5652dffb 100644 --- a/reportportal_client/service.py +++ b/reportportal_client/service.py @@ -128,17 +128,25 @@ def start_launch(self, name, start_time, description=None, tags=None, logger.debug("start_launch - Stack: %s", self.stack) return self.launch_id - def finish_launch(self, end_time, status=None): + def _finalize_launch(self, end_time, action, status): data = { "end_time": end_time, "status": status } - url = uri_join(self.base_url, "launch", self.launch_id, "finish") + url = uri_join(self.base_url, "launch", self.launch_id, action) r = self.session.put(url=url, json=data) self.stack.pop() - logger.debug("finish_launch - Stack: %s", self.stack) + logger.debug("%s_launch - Stack: %s", action, self.stack) return _get_msg(r) + def finish_launch(self, end_time, status=None): + return self._finalize_launch(end_time=end_time, action="finish", + status=status) + + def stop_launch(self, end_time, status=None): + return self._finalize_launch(end_time=end_time, action="stop", + status=status) + def start_test_item(self, name, start_time, item_type, description=None, tags=None): """ diff --git a/reportportal_client/service_async.py b/reportportal_client/service_async.py index d8c71aae..9ed8107b 100644 --- a/reportportal_client/service_async.py +++ b/reportportal_client/service_async.py @@ -232,6 +232,15 @@ def finish_launch(self, end_time, status=None): } self.queue.put_nowait(("finish_launch", args)) + def stop_launch(self, end_time, status=None): + logger.debug("Stop launch queued") + + args = { + "end_time": end_time, + "status": status + } + self.queue.put_nowait(("stop_launch", args)) + def start_test_item(self, name, start_time, item_type, description=None, tags=None): logger.debug("start_test_item queued") diff --git a/setup.py b/setup.py index 91cff80f..8736b5fd 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='reportportal-client', packages=find_packages(), - version='3.0.0', + version='3.1.0', description='Python client for Report Portal', author='Artsiom Tkachou', author_email='SupportEPMC-TSTReportPortal@epam.com',