Skip to content

Commit 759dadd

Browse files
author
frizzby
committed
Make async log batch size configurable with
rp_log_batch_size option
1 parent cabad69 commit 759dadd

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ The following parapmeters are optional:
5555
by pytest --rp-launch option, default value is 'Pytest Launch')
5656
- :code:`rp_launch_tags = 'PyTest' 'Smoke'` - list of tags
5757
- :code:`rp_launch_description = 'Smoke test'` - launch description
58+
- :code:`rp_log_batch_size = 20` - size of batch log request
5859

5960

6061
Examples

pytest_reportportal/plugin.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def pytest_sessionstart(session):
6161
project=session.config.getini("rp_project"),
6262
endpoint=session.config.getini("rp_endpoint"),
6363
uuid=session.config.getini("rp_uuid"),
64+
log_batch_size=int(session.config.getini("rp_log_batch_size"))
6465
)
6566

6667
PyTestService.start_launch(
@@ -131,3 +132,8 @@ def pytest_addoption(parser):
131132
"rp_launch_description",
132133
default="",
133134
help="Launch description")
135+
136+
parser.addini(
137+
"rp_log_batch_size",
138+
default="20",
139+
help="Size of batch log requests in async mode")

pytest_reportportal/service.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PyTestServiceClass(with_metaclass(Singleton, object)):
3434
def __init__(self):
3535
self.RP = None
3636

37-
def init_service(self, endpoint, project, uuid):
37+
def init_service(self, endpoint, project, uuid, log_batch_size):
3838
if self.RP is None:
3939
logging.debug(
4040
msg="ReportPortal - Init service: "
@@ -44,7 +44,8 @@ def init_service(self, endpoint, project, uuid):
4444
endpoint=endpoint,
4545
project=project,
4646
token=uuid,
47-
error_handler=async_error_handler)
47+
error_handler=async_error_handler,
48+
log_batch_size=log_batch_size)
4849
else:
4950
logging.debug("The pytest is already initialized")
5051
return self.RP

0 commit comments

Comments
 (0)