Skip to content

Commit

Permalink
Merge pull request #210 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Apr 27, 2023
2 parents 7092aab + ec37ce6 commit b0f5a4f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [Unreleased]
### Fixed
- Client crash in case of Client ID saving error, by @HardNorth

## [5.3.1]
### Added
- `MAX_LOG_BATCH_SIZE` constant into `log_manager` module, by @HardNorth
### Fixed
Expand Down
11 changes: 10 additions & 1 deletion reportportal_client/services/client_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import configparser
import io
import logging
import os
from uuid import uuid4

Expand All @@ -24,6 +25,10 @@
RP_PROPERTIES_FILE_PATH


logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())


class __NoSectionConfigParser(configparser.ConfigParser):
DEFAULT_SECTION = 'DEFAULT'

Expand Down Expand Up @@ -77,5 +82,9 @@ def get_client_id():
client_id = _read_client_id()
if not client_id:
client_id = str(uuid4())
_store_client_id(client_id)
try:
_store_client_id(client_id)
except (PermissionError, IOError) as error:
logger.exception('[%s] Unknown exception has occurred. '
'Skipping client ID saving.', error)
return client_id
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import setup, find_packages

__version__ = '5.3.1'
__version__ = '5.3.2'

TYPE_STUBS = ['*.pyi']

Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def get_call(*args, **kwargs):

@mock.patch('reportportal_client.client.getenv')
@mock.patch('reportportal_client.client.send_event')
def test_skip_analytics(send_event, getenv):
def test_skip_statistics(send_event, getenv):
getenv.return_value = '1'
client = RPClient('http://endpoint', 'project', 'token')
client.session = mock.Mock()
Expand All @@ -133,7 +133,7 @@ def test_skip_analytics(send_event, getenv):

@mock.patch('reportportal_client.client.getenv')
@mock.patch('reportportal_client.client.send_event')
def test_analytics(send_event, getenv):
def test_statistics(send_event, getenv):
getenv.return_value = ''
client = RPClient('http://endpoint', 'project', 'token')
client.session = mock.Mock()
Expand Down

0 comments on commit b0f5a4f

Please sign in to comment.