Skip to content

Missed mode in create_client call  #362

@ageleisha-ms

Description

@ageleisha-ms

Can't create launch for Debug mode.
pytest-reportportal==5.4.0
reportportal-client==5.5.4

pytest_sessionstart -> config.py_test_service.start() ->
The mode is not set for the Client.

self.rp = create_client(
            client_type=self._config.rp_client_type,
            endpoint=self._config.rp_endpoint,
            project=self._config.rp_project,
            api_key=self._config.rp_api_key,
            is_skipped_an_issue=self._config.rp_is_skipped_an_issue,
            log_batch_size=self._config.rp_log_batch_size,
            retries=self._config.rp_api_retries,
            verify_ssl=self._config.rp_verify_ssl,
            launch_uuid=launch_id,
            log_batch_payload_size=self._config.rp_log_batch_payload_size,
            launch_uuid_print=self._config.rp_launch_uuid_print,
            print_output=self._config.rp_launch_uuid_print_output,
            http_timeout=self._config.rp_http_timeout
        )

service.py -> start_launch() ->self.rp.start_launch(**sl_pt)
sl_pt = {'attributes': [{'key': 'agent', 'value': 'pytest-reportportal|5.4.0', 'system': True}, {'key': 'cpu', 'value': 'arm', 'system': True}, {'key': 'machine', 'value': 'arm64', 'system': True}, {'key': 'os', 'value': 'Darwin', 'system': True}], 'name': 'TEST_LAUNCH', 'start_time': '1711439080452', 'description': None, 'mode': 'DEBUG', 'rerun': False, 'rerun_of': None}

But on start_launch() ->
request_payload = LaunchStartRequest(
name=name,
start_time=start_time,
attributes=verify_value_length(attributes) if self.truncate_attributes else attributes,
description=description,
mode=self.mode,
rerun=rerun,
rerun_of=rerun_of
).payload

self.mode = Default as mode: str = 'DEFAULT' in init and was not provided in create_client()

From old client code

if 'mode' in my_kwargs:
            warnings.warn(
                message='Argument `mode` is deprecated since 5.2.5 and will be subject for removing in the '
                        'next major version. Use `mode` argument in the class constructor instead.',
                category=DeprecationWarning,
                stacklevel=2
            )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions