Skip to content

Commit

Permalink
Unify ReportPortal name
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Sep 25, 2023
1 parent a649a1b commit f06adf0
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]
### Changed
- Unified ReportPortal product naming, by @HardNorth
- `RPClient` internal item stack implementation changed to `LifoQueue` to maintain concurrency better, by @HardNorth
### Removed
- Unused `delayed_assert` dependency, by @HardNorth
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ from reportportal_client.helpers import timestamp

endpoint = "http://docker.local:8080"
project = "default"
# You can get UUID from user profile page in the Report Portal.
# You can get UUID from user profile page in the ReportPortal.
api_key = "1adf271d-505f-44a8-ad71-0afbdf8c83bd"
launch_name = "Test launch"
launch_doc = "Testing logging with attachment."
Expand Down
10 changes: 5 additions & 5 deletions reportportal_client/_local/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Report Portal client context storing and retrieving module."""
"""ReportPortal client context storing and retrieving module."""

# Copyright (c) 2022 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -19,17 +19,17 @@


def current():
"""Return current Report Portal client."""
"""Return current ReportPortal client."""
if hasattr(__INSTANCES, 'current'):
return __INSTANCES.current


def set_current(client):
"""Save Report Portal client as current.
"""Save ReportPortal client as current.
The method is not intended to use used by users. Report Portal client calls
The method is not intended to use used by users. ReportPortal client calls
it itself when new client is created.
:param client: Report Portal client
:param client: ReportPortal client
"""
__INSTANCES.current = client
16 changes: 8 additions & 8 deletions reportportal_client/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""This module contains Report Portal Client class."""
"""This module contains ReportPortal Client class."""

# Copyright (c) 2023 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -50,10 +50,10 @@ def last(self):


class RPClient:
"""Report portal client.
"""ReportPortal client.
The class is supposed to use by Report Portal agents: both custom and
official to make calls to Report Portal. It handles HTTP request and
The class is supposed to use by ReportPortal agents: both custom and
official to make calls to RReportPortal. It handles HTTP request and
response bodies generation and serialization, connection retries and log
batching.
NOTICE: the class is not thread-safe, use new class instance for every new
Expand Down Expand Up @@ -104,7 +104,7 @@ def __init__(
) -> None:
"""Initialize required attributes.
:param endpoint: Endpoint of the report portal service
:param endpoint: Endpoint of the ReportPortal service
:param project: Project name to report to
:param api_key: Authorization API key
:param log_batch_size: Option to set the maximum number of
Expand Down Expand Up @@ -351,7 +351,7 @@ def get_project_settings(self) -> Optional[Dict]:

def log(self, time: str, message: str, level: Optional[Union[int, str]] = None,
attachment: Optional[Dict] = None, item_id: Optional[str] = None) -> None:
"""Send log message to the Report Portal.
"""Send log message to the ReportPortal.
:param time: Time in UTC
:param message: Log message text
Expand Down Expand Up @@ -430,7 +430,7 @@ def start_launch(self,
self._log_manager.launch_id = self.launch_id = response.id
logger.debug('start_launch - ID: %s', self.launch_id)
if self.launch_uuid_print and self.print_output:
print(f'Report Portal Launch UUID: {self.launch_id}', file=self.print_output)
print(f'ReportPortal Launch UUID: {self.launch_id}', file=self.print_output)
return self.launch_id

def start_test_item(self,
Expand Down Expand Up @@ -508,7 +508,7 @@ def terminate(self, *_: Any, **__: Any) -> None:

def update_test_item(self, item_uuid: str, attributes: Optional[Union[List, Dict]] = None,
description: Optional[str] = None) -> Optional[str]:
"""Update existing test item at the Report Portal.
"""Update existing test item at the ReportPortal.
:param str item_uuid: Test item UUID returned on the item start
:param str description: Test item description
Expand Down
4 changes: 2 additions & 2 deletions reportportal_client/core/rp_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, session_method, url, data=None, json=None,
self.name = name

def make(self):
"""Make HTTP request to the Report Portal API."""
"""Make HTTP request to the ReportPortal API."""
try:
return RPResponse(self.session_method(
self.url, data=self.data, json=self.json,
Expand All @@ -78,7 +78,7 @@ def make(self):
# https://github.com/reportportal/client-Python/issues/39
except (KeyError, IOError, ValueError, TypeError) as exc:
logger.warning(
"Report Portal %s request failed",
"ReportPortal %s request failed",
self.name,
exc_info=exc
)
Expand Down
6 changes: 3 additions & 3 deletions reportportal_client/core/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self,
:param session: Session object
:param endpoint: Endpoint url
:param launch_id: Report portal launch UUID
:param launch_id: ReportPortal launch UUID
:param project_name: RP project name
"""
self.session = session
Expand Down Expand Up @@ -124,7 +124,7 @@ def start_test_item(self,

def update_test_item(self, api_version, item_uuid, attributes=None,
description=None, **kwargs):
"""Update existing test item at the Report Portal.
"""Update existing test item at the ReportPortal.
:param api_version: RP API version
:param str item_uuid: test item UUID returned on the item start
Expand Down Expand Up @@ -201,7 +201,7 @@ def get_test_item(self, item_uuid):
:param item_uuid: test item uuid
:return: test item object if found else None
"""
# Todo: add 'force' parameter to get item from report portal server
# Todo: add 'force' parameter to get item from ReportPortal server
# instead of cache and update cache data according to this request
return self._find_item(item_uuid, self.__storage)

Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/core/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __lt__(self, other):


class APIWorker(object):
"""Worker that makes HTTP requests to the Report Portal."""
"""Worker that makes HTTP requests to the ReportPortal."""

def __init__(self, task_queue):
"""Initialize instance attributes."""
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def dict_to_payload(dictionary):
"""Convert incoming dictionary to the list of dictionaries.
This function transforms the given dictionary of tags/attributes into
the format required by the Report Portal API. Also, we add the system
the format required by the ReportPortal API. Also, we add the system
key to every tag/attribute that indicates that the key should be hidden
from the user in UI.
:param dictionary: Dictionary containing tags/attributes
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/items/rp_base_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, rp_url, session, project_name,
launch_uuid, generated_id):
"""Initialize instance attributes.
:param rp_url: report portal url
:param rp_url: ReportPortal url
:param session: Session object
:param project_name: RP project name
:param launch_uuid: Parent launch UUID
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/items/rp_log_items/rp_log_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, rp_url, session, project_name,
launch_uuid, generated_id):
"""Initialize instance attributes.
:param rp_url: report portal URL
:param rp_url: ReportPortal URL
:param session: Session object
:param project_name: RP project name
:param launch_uuid: Parent launch UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, rp_url, session, project_name, item_name,
item_type, launch_uuid, generated_id, **kwargs):
"""Initialize instance attributes.
:param rp_url: report portal url
:param rp_url: ReportPortal url
:param session: Session object
:param project_name: RP project name
:param item_name: RP item name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, rp_url, session, project_name, parent_item,
**kwargs):
"""Initialize instance attributes.
:param rp_url: report portal url
:param rp_url: ReportPortal url
:param session: Session object
:param project_name: RP project name
:param item_name: RP item name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, rp_url, session, project_name, item_name,
item_type, launch_uuid, generated_id, **kwargs):
"""Initialize instance attributes.
:param rp_url: report portal url
:param rp_url: ReportPortal url
:param session: Session object
:param project_name: RP project name
:param item_name: RP item name
Expand Down
13 changes: 6 additions & 7 deletions reportportal_client/logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
"""Report portal logging handling module."""
"""ReportPortal logging handling module."""

import logging
import sys
Expand Down Expand Up @@ -111,12 +111,11 @@ def __init__(self, level=logging.NOTSET, filter_client_logs=False,
:param level: level of logging
:param filter_client_logs: if True throw away logs emitted by a
ReportPortal client
:param endpoint: Report Portal endpoint URL, used to filter
out urllib3 logs, mutes Report Portal HTTP logs if set, optional
parameter
:param ignored_record_names: a tuple of record names which will be
filtered out by the handler (with startswith method)
ReportPortal client
:param endpoint: ReportPortal endpoint URL, used to filter out urllib3 logs, mutes
ReportPortal HTTP logs if set, optional parameter
:param ignored_record_names: a tuple of record names which will be filtered out by the handler
(with startswith method)
"""
super(RPLogHandler, self).__init__(level)
self.filter_client_logs = filter_client_logs
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/logs/log_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self, rp_url, session, api_version, launch_id, project_name,
max_payload_size=MAX_LOG_BATCH_PAYLOAD_SIZE):
"""Initialize instance attributes.
:param rp_url: Report portal URL
:param rp_url: ReportPortal URL
:param session: HTTP Session object
:param api_version: RP API version
:param launch_id: Parent launch UUID
Expand Down
18 changes: 9 additions & 9 deletions reportportal_client/steps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
"""Report portal Nested Step handling module.
"""ReportPortal Nested Step handling module.
The module for handling and reporting Report Portal Nested Steps inside python
The module for handling and reporting ReportPortal Nested Steps inside python
test frameworks. Import 'step' function to use it as decorator or together with
'with' keyword to divide your tests on smaller steps.
Expand Down Expand Up @@ -59,7 +59,7 @@ class StepReporter:
def __init__(self, rp_client):
"""Initialize required attributes.
:param rp_client: Report Portal client which will be used to report
:param rp_client: ReportPortal client which will be used to report
steps
"""
self.client = rp_client
Expand All @@ -69,7 +69,7 @@ def start_nested_step(self,
start_time,
parameters=None,
**kwargs):
"""Start Nested Step on Report Portal.
"""Start Nested Step on ReportPortal.
:param name: Nested Step name
:param start_time: Nested Step start time
Expand All @@ -88,7 +88,7 @@ def finish_nested_step(self,
end_time,
status=None,
**kwargs):
"""Finish a Nested Step on Report Portal.
"""Finish a Nested Step on ReportPortal.
:param item_id: Nested Step item ID
:param end_time: Nested Step finish time
Expand All @@ -107,7 +107,7 @@ def __init__(self, name, params, status, rp_client):
:param params: Nested Step parameters
:param status: Nested Step status which will be reported on
successful step finish
:param rp_client: Report Portal client which will be used to report
:param rp_client: ReportPortal client which will be used to report
the step
"""
self.name = name
Expand Down Expand Up @@ -170,16 +170,16 @@ def wrapper(*args, **kwargs):
def step(name_source, params=None, status='PASSED', rp_client=None):
"""Nested step report function.
Create a Nested Step inside a test method on Report Portal.
Create a Nested Step inside a test method on ReportPortal.
:param name_source: a function or string which will be used as step's name
:param params: nested step parameters which will be reported as the
first step entry. If 'name_source' is a function
reference and this parameter is not specified, they
will be taken from the function.
:param status: the status which will be reported after the step
passed. Can be any of legal Report Portal statuses.
passed. Can be any of legal ReportPortal statuses.
E.G.: PASSED, WARN, INFO, etc. Default value is PASSED
:param rp_client: overrides Report Portal client which will be used in
:param rp_client: overrides ReportPortal client which will be used in
step reporting
:return: a step context object
"""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def read_file(fname):
'reportportal_client.steps': TYPE_STUBS
},
version=__version__,
description='Python client for Report Portal v5.',
description='Python client for ReportPortal v5.',
long_description=read_file('README.md'),
long_description_content_type='text/markdown',
author='Report Portal Team',
author='ReportPortal Team',
author_email='support@reportportal.io',
url='https://github.com/reportportal/client-Python',
download_url=('https://github.com/reportportal/client-Python/'
Expand Down
8 changes: 4 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_launch_uuid_print():
client.session = mock.Mock()
client._skip_analytics = True
client.start_launch('Test Launch', timestamp())
assert 'Report Portal Launch UUID: ' in str_io.getvalue()
assert 'ReportPortal Launch UUID: ' in str_io.getvalue()


def test_no_launch_uuid_print():
Expand All @@ -216,7 +216,7 @@ def test_no_launch_uuid_print():
client.session = mock.Mock()
client._skip_analytics = True
client.start_launch('Test Launch', timestamp())
assert 'Report Portal Launch UUID: ' not in str_io.getvalue()
assert 'ReportPortal Launch UUID: ' not in str_io.getvalue()


@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO)
Expand All @@ -227,7 +227,7 @@ def test_launch_uuid_print_default_io(mock_stdout):
client._skip_analytics = True
client.start_launch('Test Launch', timestamp())

assert 'Report Portal Launch UUID: ' in mock_stdout.getvalue()
assert 'ReportPortal Launch UUID: ' in mock_stdout.getvalue()


@mock.patch('reportportal_client.client.sys.stdout', new_callable=StringIO)
Expand All @@ -238,4 +238,4 @@ def test_launch_uuid_print_default_print(mock_stdout):
client._skip_analytics = True
client.start_launch('Test Launch', timestamp())

assert 'Report Portal Launch UUID: ' not in mock_stdout.getvalue()
assert 'ReportPortal Launch UUID: ' not in mock_stdout.getvalue()

0 comments on commit f06adf0

Please sign in to comment.