Skip to content

Commit

Permalink
Merge pull request #22 from tmarenko/master
Browse files Browse the repository at this point in the history
Force finish (stopping) launch added
  • Loading branch information
Dzmitry Humianiuk authored Mar 14, 2018
2 parents 7ae7c4a + bc62769 commit cd0509b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
14 changes: 11 additions & 3 deletions reportportal_client/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
9 changes: 9 additions & 0 deletions reportportal_client/service_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='[email protected]',
Expand Down

0 comments on commit cd0509b

Please sign in to comment.