diff --git a/CHANGELOG.md b/CHANGELOG.md index 1187c3e..e8ab780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] ### Added +- Return back deprecated `rp_log_batch_payload_size` parameter for sake of backward compatibility, by @HardNorth + +## [5.5.3] +### Added - OAuth 2.0 Password Grant authentication, by @HardNorth ### Changed - Client version updated to [5.6.7](https://github.com/reportportal/client-Python/releases/tag/5.6.7), by @HardNorth diff --git a/pytest_reportportal/config.py b/pytest_reportportal/config.py index a16413d..2d7a630 100644 --- a/pytest_reportportal/config.py +++ b/pytest_reportportal/config.py @@ -113,10 +113,23 @@ def __init__(self, pytest_config: Config) -> None: self.rp_launch_description = self.find_option(pytest_config, "rp_launch_description") self.rp_log_batch_size = int(self.find_option(pytest_config, "rp_log_batch_size")) batch_payload_size_limit = self.find_option(pytest_config, "rp_log_batch_payload_limit") + batch_payload_size = self.find_option(pytest_config, "rp_log_batch_payload_size") + if batch_payload_size: + warnings.warn( + "Parameter `rp_log_batch_payload_size` is deprecated since 5.5.4 " + "and will be subject for removing in the next major version. Use `rp_log_batch_payload_limit` argument" + " instead.", + DeprecationWarning, + 2, + ) + if not batch_payload_size_limit: + batch_payload_size_limit = batch_payload_size + if batch_payload_size_limit: self.rp_log_batch_payload_limit = int(batch_payload_size_limit) else: self.rp_log_batch_payload_limit = MAX_LOG_BATCH_PAYLOAD_SIZE + self.rp_log_level = get_actual_log_level(pytest_config, "rp_log_level") self.rp_log_format = self.find_option(pytest_config, "rp_log_format") self.rp_thread_logging = to_bool(self.find_option(pytest_config, "rp_thread_logging") or False) diff --git a/pytest_reportportal/plugin.py b/pytest_reportportal/plugin.py index f400d33..14a46a9 100644 --- a/pytest_reportportal/plugin.py +++ b/pytest_reportportal/plugin.py @@ -27,7 +27,6 @@ from pytest import Item, Session from reportportal_client import RP, RPLogHandler from reportportal_client.errors import ResponseError -from reportportal_client.logs import MAX_LOG_BATCH_PAYLOAD_SIZE from pytest_reportportal import LAUNCH_WAIT_TIMEOUT from pytest_reportportal.config import AgentConfig @@ -595,9 +594,12 @@ def add_shared_option(name, help_str, default=None, action="store"): parser.addini("rp_log_batch_size", default="20", help="Size of batch log requests in async mode") parser.addini( "rp_log_batch_payload_limit", - default=str(MAX_LOG_BATCH_PAYLOAD_SIZE), help="Maximum payload size in bytes of async batch log requests", ) + parser.addini( + "rp_log_batch_payload_size", + help="DEPRECATED: Maximum payload size in bytes of async batch log requests", + ) parser.addini("rp_ignore_attributes", type="args", help="Ignore specified pytest markers, i.e parametrize") parser.addini( "rp_is_skipped_an_issue", default=True, type="bool", help="Treat skipped tests as required investigation" diff --git a/setup.py b/setup.py index fb8562a..943cab7 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ from setuptools import setup -__version__ = "5.5.3" +__version__ = "5.5.4" def read_file(fname): diff --git a/tests/unit/test_plugin.py b/tests/unit/test_plugin.py index 5d3f745..41d7ac0 100644 --- a/tests/unit/test_plugin.py +++ b/tests/unit/test_plugin.py @@ -258,6 +258,7 @@ def test_pytest_addoption_adds_correct_ini_file_arguments(): "rp_tests_attributes", "rp_log_batch_size", "rp_log_batch_payload_limit", + "rp_log_batch_payload_size", "rp_ignore_attributes", "rp_is_skipped_an_issue", "rp_hierarchy_code",