Skip to content

Commit 22ec127

Browse files
author
Dzmitry Humianiuk
authored
Merge pull request #123 from pshv/master
Added retries option in accordance with Python client changes
2 parents 08faa6a + 081b6da commit 22ec127

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

pytest_reportportal/plugin.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def pytest_sessionstart(session):
5454
log_batch_size=int(session.config.getini('rp_log_batch_size')),
5555
ignore_errors=bool(session.config.getini('rp_ignore_errors')),
5656
ignored_tags=session.config.getini('rp_ignore_tags'),
57-
verify_ssl=session.config.getini('rp_verify_ssl')
57+
verify_ssl=session.config.getini('rp_verify_ssl'),
58+
retries=int(session.config.getini('retries')),
5859
)
5960

6061
session.config.py_test_service.start_launch(
@@ -305,3 +306,8 @@ def pytest_addoption(parser):
305306
help="In case of True, include the suite's relative file path in the launch name as a convention of "
306307
"'<RELATIVE_FILE_PATH>::<SUITE_NAME>'. In case of False, set the launch name to be the suite name "
307308
"only - this flag is relevant only when 'rp_hierarchy_module' flag is set to False")
309+
310+
parser.addini(
311+
'retries',
312+
default='0',
313+
help='Amount of retries for performing REST calls to RP server')

pytest_reportportal/service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def __init__(self):
7676
self._item_parts = {}
7777

7878
def init_service(self, endpoint, project, uuid, log_batch_size,
79-
ignore_errors, ignored_tags, verify_ssl=True):
79+
ignore_errors, ignored_tags, verify_ssl=True,
80+
retries=0):
8081
self._errors = queue.Queue()
8182
if self.RP is None:
8283
self.ignore_errors = ignore_errors
@@ -91,6 +92,7 @@ def init_service(self, endpoint, project, uuid, log_batch_size,
9192
project=project,
9293
token=uuid,
9394
error_handler=self.async_error_handler,
95+
retries=retries,
9496
log_batch_size=log_batch_size # ,
9597
# verify_ssl=verify_ssl
9698
)

0 commit comments

Comments
 (0)