Skip to content

Commit 0a92662

Browse files
authored
Updated finish_launch to update launch tags
1 parent 46b0f91 commit 0a92662

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

reportportal_client/service.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def start_launch(self,
234234
logger.debug("start_launch - ID: %s", self.launch_id)
235235
return self.launch_id
236236

237-
def finish_launch(self, end_time, status=None, **kwargs):
237+
def finish_launch(self, end_time, status=None, attributes=None, **kwargs):
238238
"""Finish a launch with the given parameters.
239239
240240
Status can be one of the followings:
@@ -243,11 +243,14 @@ def finish_launch(self, end_time, status=None, **kwargs):
243243
# process log batches firstly:
244244
if self._batch_logs:
245245
self.log_batch([], force=True)
246+
if attributes and isinstance(attributes, dict):
247+
attributes = _dict_to_payload(attributes)
246248
data = {
247249
"endTime": end_time,
248-
"status": status
250+
"status": status,
251+
"attributes": attributes
249252
}
250-
url = uri_join(self.base_url_v1, "launch", self.launch_id, "finish")
253+
url = uri_join(self.base_url_v2, "launch", self.launch_id, "finish")
251254
r = self.session.put(url=url, json=data, verify=self.verify_ssl)
252255
logger.debug("finish_launch - ID: %s", self.launch_id)
253256
return _get_msg(r)

0 commit comments

Comments
 (0)