Skip to content

Commit 4c4e525

Browse files
author
Dzmitry Humianiuk
authored
Merge branch 'master' into master
2 parents db1bf9c + 7a211c4 commit 4c4e525

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

reportportal_client/service.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,24 @@ def uri_join(*uri_parts):
8787
class ReportPortalService(object):
8888
"""Service class with report portal event callbacks."""
8989

90-
def __init__(self, endpoint, project, token, api_base="api/v1"):
90+
def __init__(self, endpoint, project, token, api_base="api/v1",
91+
is_skipped_an_issue=True):
9192
"""Init the service class.
9293
9394
Args:
9495
endpoint: endpoint of report portal service.
9596
project: project name to use for launch names.
9697
token: authorization token.
9798
api_base: defaults to api/v1, can be changed to other version.
99+
is_skipped_an_issue: option to mark skipped tests as not
100+
'To Investigate' items on Server side.
98101
"""
99102
super(ReportPortalService, self).__init__()
100103
self.endpoint = endpoint
101104
self.api_base = api_base
102105
self.project = project
103106
self.token = token
107+
self.is_skipped_an_issue = is_skipped_an_issue
104108
self.base_url = uri_join(self.endpoint,
105109
self.api_base,
106110
self.project)
@@ -188,6 +192,11 @@ def start_test_item(self, name, start_time, item_type, description=None,
188192
return item_id
189193

190194
def finish_test_item(self, end_time, status, issue=None):
195+
# check if skipped test should not be marked as "TO INVESTIGATE"
196+
if issue is None and status == "SKIPPED" \
197+
and not self.is_skipped_an_issue:
198+
issue = {"issue_type": "NOT_ISSUE"}
199+
191200
data = {
192201
"end_time": end_time,
193202
"status": status,

reportportal_client/service_async.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ class ReportPortalServiceAsync(object):
117117
"""
118118

119119
def __init__(self, endpoint, project, token, api_base="api/v1",
120-
error_handler=None, log_batch_size=20):
120+
error_handler=None, log_batch_size=20,
121+
is_skipped_an_issue=True):
121122
"""Init the service class.
122123
123124
Args:
@@ -127,12 +128,14 @@ def __init__(self, endpoint, project, token, api_base="api/v1",
127128
api_base: defaults to api/v1, can be changed to other version.
128129
error_handler: function to be called to handle errors occurred
129130
during items processing (in thread)
131+
is_skipped_an_issue: option to mark skipped tests as not
132+
'To Investigate' items on Server side.
130133
"""
131134
super(ReportPortalServiceAsync, self).__init__()
132135
self.error_handler = error_handler
133136
self.log_batch_size = log_batch_size
134137
self.rp_client = ReportPortalService(
135-
endpoint, project, token, api_base)
138+
endpoint, project, token, api_base, is_skipped_an_issue)
136139
self.log_batch = []
137140
self.supported_methods = ["start_launch", "finish_launch",
138141
"start_test_item", "finish_test_item", "log"]

0 commit comments

Comments
 (0)