Skip to content

Commit 87ecd45

Browse files
authored
Merge pull request #179 from reportportal/develop
Release
2 parents 9bd8dfc + 5012265 commit 87ecd45

27 files changed

+397
-359
lines changed

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
run: tox
5454

5555
- name: Upload coverage to Codecov
56-
if: matrix.python-version == 3.7 && success()
56+
if: matrix.python-version == 3.8 && success()
5757
uses: codecov/codecov-action@v3
5858
with:
5959
files: coverage.xml

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## [Unreleased]
44
### Added
5+
- `RP_CLIENT_TYPE` configuration variable, by @HardNorth
6+
- `RP_CONNECT_TIMEOUT` and `RP_READ_TIMEOUT` configuration variables, by @HardNorth
7+
### Changed
8+
- Client version updated on [5.5.0](https://github.com/reportportal/client-Python/releases/tag/5.5.0), by @HardNorth
9+
### Removed
10+
- Dependency on `six`, by @HardNorth
11+
12+
## [5.4.0]
13+
### Added
514
- `RP_LAUNCH_UUID_PRINT` and `RP_LAUNCH_UUID_PRINT_OUTPUT` configuration variables, by @HardNorth
615
### Changed
716
- Internal item list was replaced with LifoQueue, by @HardNorth

README.md

+11-21
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![PyPI](https://img.shields.io/pypi/v/robotframework-reportportal.svg?maxAge=259200)](https://pypi.python.org/pypi/robotframework-reportportal)
44
[![Python versions](https://img.shields.io/pypi/pyversions/robotframework-reportportal.svg)](https://pypi.org/project/robotframework-reportportal)
55
[![Build Status](https://github.com/reportportal/agent-Python-RobotFramework/actions/workflows/tests.yml/badge.svg)](https://github.com/reportportal/agent-Python-RobotFramework/actions/workflows/tests.yml)
6-
[![codecov.io](https://codecov.io/gh/reportportal/agent-Python-RobotFramework/branch/master/graph/badge.svg)](https://codecov.io/gh/reportportal/agent-Python-RobotFramework)
6+
[![codecov.io](https://codecov.io/gh/reportportal/agent-Python-RobotFramework/branch/develop/graph/badge.svg)](https://codecov.io/gh/reportportal/agent-Python-RobotFramework)
77
[![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/)
88
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
99
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)
@@ -26,26 +26,6 @@ The latest stable version of library is available on PyPI:
2626

2727
pip install robotframework-reportportal
2828

29-
[reportportal-client](https://github.com/reportportal/client-Python)
30-
and [six](https://pypi.org/project/six/) will be installed as dependencies
31-
32-
**IMPORTANT!**
33-
The latest version **does not** support Report Portal versions below 5.0.0.
34-
35-
Specify the last one release of the client version 3 to install or update the
36-
client for other versions of Report Portal below 5.0.0:
37-
38-
```
39-
pip install robotframework-reportportal~=3.0
40-
```
41-
42-
## Contribution
43-
44-
All the fixes for the agent that supports Report Portal versions below 5.0.0
45-
should go into the v3 branch.
46-
The master branch will store the code base for the agent for Report Portal
47-
versions 5 and above.
48-
4929
## Usage
5030

5131
### Properties
@@ -66,14 +46,24 @@ REQUIRED:
6646
NOT REQUIRED:
6747

6848
```
49+
--variable RP_CLIENT_TYPE:"SYNC"
50+
- Type of the under-the-hood ReportPortal client implamentation. Possible values: [SYNC, ASYNC_THREAD, ASYNC_BATCHED].
6951
--variable RP_LAUNCH_UUID:"id_of_existing_rp_launch"
7052
- ID of existing Report Portal launch
7153
--variable RP_LAUNCH_DOC:"some_documentation_for_launch"
7254
- Description for the launch
7355
--variable RP_LAUNCH_ATTRIBUTES:"RF tag_name:tag_value"
7456
- Space-separated list of tags/attributes for the launch
57+
--variable RP_LAUNCH_UUID_PRINT:"True"
58+
- Default value is "False", enables printing Launch UUID on test run start.
59+
--variable RP_LAUNCH_UUID_PRINT_OUTPUT:"stderr"
60+
- Default value is "stdout", Launch UUID print output. Possible values: [stderr, stdout].
7561
--variable RP_TEST_ATTRIBUTES:"key1:value1 key1:value2 tag key2:value3"
7662
- Space-separated list of tags/attributes for the tests
63+
--variable RP_CONNECT_TIMEOUT:"20"
64+
- Default value is "10.0", connection timeout to ReportPortal server.
65+
--variable RP_READ_TIMEOUT:"20"
66+
- Default value is "10.0", response read timeout for ReportPortal connection.
7767
--variable RP_LOG_BATCH_SIZE:"10"
7868
- Default value is "20", affects size of async batch log requests
7969
--variable RP_LOG_BATCH_PAYLOAD_SIZE:"10240000"

requirements.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Basic dependencies
2-
python-dateutil>=2.8.1
3-
reportportal-client==5.4.0
2+
python-dateutil~=2.8.1
3+
reportportal-client~=5.5.1
44
robotframework
5-
six>=1.15.0

robotframework_reportportal/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""This package contains modules for reporting to Report Portal."""
2-
31
# Copyright (c) 2023 EPAM Systems
42
# Licensed under the Apache License, Version 2.0 (the "License");
53
# you may not use this file except in compliance with the License.
@@ -12,3 +10,5 @@
1210
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1311
# See the License for the specific language governing permissions and
1412
# limitations under the License
13+
14+
"""This package contains modules for reporting to Report Portal."""

robotframework_reportportal/listener.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""This module includes Robot Framework listener interfaces."""
2-
31
# Copyright 2023 EPAM Systems
42
#
53
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,15 +12,16 @@
1412
# See the License for the specific language governing permissions and
1513
# limitations under the License.
1614

15+
"""This module includes Robot Framework listener interfaces."""
16+
1717
import logging
1818
import os
1919
from functools import wraps
2020
from mimetypes import guess_type
2121
from typing import Optional, Dict, Union, Any
22-
from queue import LifoQueue
2322
from warnings import warn
2423

25-
from reportportal_client.helpers import gen_attributes
24+
from reportportal_client.helpers import gen_attributes, LifoQueue
2625

2726
from .model import Keyword, Launch, Test, LogMessage, Suite
2827
from .service import RobotService
@@ -32,13 +31,6 @@
3231
logger = logging.getLogger(__name__)
3332

3433

35-
class _LifoQueue(LifoQueue):
36-
def last(self):
37-
with self.mutex:
38-
if self._qsize():
39-
return self.queue[-1]
40-
41-
4234
def check_rp_enabled(func):
4335
"""Verify is RP is enabled in config."""
4436
@wraps(func)
@@ -54,14 +46,14 @@ def wrap(*args, **kwargs):
5446
class listener:
5547
"""Robot Framework listener interface for reporting to Report Portal."""
5648

57-
_items: _LifoQueue = ...
49+
_items: LifoQueue = ...
5850
_service: Optional[RobotService] = ...
5951
_variables: Optional[Variables] = ...
6052
ROBOT_LISTENER_API_VERSION = 2
6153

6254
def __init__(self) -> None:
6355
"""Initialize listener attributes."""
64-
self._items = _LifoQueue()
56+
self._items = LifoQueue()
6557
self._service = None
6658
self._variables = None
6759

robotframework_reportportal/model.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""This module contains models representing Robot Framework test items."""
2-
31
# Copyright (c) 2023 EPAM Systems
42
# Licensed under the Apache License, Version 2.0 (the "License");
53
# you may not use this file except in compliance with the License.
@@ -13,10 +11,9 @@
1311
# See the License for the specific language governing permissions and
1412
# limitations under the License
1513

16-
import os
14+
"""This module contains models representing Robot Framework test items."""
1715

18-
from reportportal_client.helpers import convert_string
19-
from six import text_type
16+
import os
2017

2118

2219
class Suite(object):
@@ -184,14 +181,10 @@ def __init__(self, name, attributes, parent_type=None):
184181

185182
def get_name(self):
186183
"""Get name of the keyword suitable for Report Portal."""
187-
assign = convert_string(', '.join(self.assign))
184+
assign = ', '.join(self.assign)
188185
assignment = '{0} = '.format(assign) if self.assign else ''
189186
arguments = ', '.join(self.args)
190-
full_name = '{0}{1} ({2})'.format(
191-
assignment,
192-
convert_string(self.name),
193-
convert_string(arguments)
194-
)
187+
full_name = f'{assignment}{self.name} ({arguments})'
195188
return full_name[:256]
196189

197190
def get_type(self):
@@ -216,7 +209,7 @@ def update(self, attributes):
216209
return self
217210

218211

219-
class LogMessage(text_type):
212+
class LogMessage(str):
220213
"""Class represents Robot Framework messages."""
221214

222215
def __init__(self, message):

robotframework_reportportal/model.pyi

+69-70
Original file line numberDiff line numberDiff line change
@@ -11,92 +11,91 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License
1313

14-
from six import text_type
15-
from typing import Any, Dict, List, Optional, Text, Tuple, Union
14+
from typing import Any, Dict, List, Optional, Tuple, Union
1615

1716
class Suite:
18-
attributes: Union[List[Text], Dict[Text]] = ...
19-
doc: Text = ...
20-
end_time: Text = ...
21-
longname: Text = ...
22-
message: Text = ...
23-
metadata: Dict[Text, Text] = ...
24-
name: Text = ...
25-
robot_id: Text = ...
26-
rp_item_id: Optional[Text] = ...
27-
rp_parent_item_id: Optional[Text] = ...
28-
start_time: Optional[Text] = ...
29-
statistics: Text = ...
30-
status: Text = ...
31-
suites: List[Text] = ...
32-
tests: List[Text] = ...
17+
attributes: Union[List[str], Dict[str, Any]] = ...
18+
doc: str = ...
19+
end_time: str = ...
20+
longname: str = ...
21+
message: str = ...
22+
metadata: Dict[str, str] = ...
23+
name: str = ...
24+
robot_id: str = ...
25+
rp_item_id: Optional[str] = ...
26+
rp_parent_item_id: Optional[str] = ...
27+
start_time: Optional[str] = ...
28+
statistics: str = ...
29+
status: str = ...
30+
suites: List[str] = ...
31+
tests: List[str] = ...
3332
total_tests: int = ...
34-
type: Text = 'SUITE'
35-
def __init__(self, name: Text, attributes: Dict[Text, Any]) -> None: ...
33+
type: str = 'SUITE'
34+
def __init__(self, name: str, attributes: Dict[str, Any]) -> None: ...
3635
@property
37-
def source(self) -> Text: ...
38-
def update(self, attributes: Dict[Text, Any]) -> Union[Launch, Suite]: ...
36+
def source(self) -> str: ...
37+
def update(self, attributes: Dict[str, Any]) -> Union[Launch, Suite]: ...
3938

4039
class Launch(Suite):
41-
type: Text = 'LAUNCH'
42-
def __init__(self, name: Text, attributes: Dict[Text, Any]) -> None: ...
40+
type: str = 'LAUNCH'
41+
def __init__(self, name: str, attributes: Dict[str, Any]) -> None: ...
4342

4443
class Test:
45-
_critical: Text = ...
46-
_tags: List[Text] = ...
47-
_attributes: Dict[Text, Any] = ...
48-
attributes: List[Dict[Text, Text]] = ...
49-
doc: Text = ...
50-
end_time: Text = ...
51-
longname: Text = ...
52-
message: Text = ...
53-
name: Text = ...
54-
robot_id: Text = ...
55-
rp_item_id: Optional[Text] = ...
56-
rp_parent_item_id: Optional[Text] = ...
57-
start_time: Text = ...
58-
status: Text = ...
59-
template: Text = ...
60-
type: Text = 'TEST'
61-
def __init__(self, name: Text, attributes: Dict[Text, Any]) -> None: ...
44+
_critical: str = ...
45+
_tags: List[str] = ...
46+
_attributes: Dict[str, Any] = ...
47+
attributes: List[Dict[str, str]] = ...
48+
doc: str = ...
49+
end_time: str = ...
50+
longname: str = ...
51+
message: str = ...
52+
name: str = ...
53+
robot_id: str = ...
54+
rp_item_id: Optional[str] = ...
55+
rp_parent_item_id: Optional[str] = ...
56+
start_time: str = ...
57+
status: str = ...
58+
template: str = ...
59+
type: str = 'TEST'
60+
def __init__(self, name: str, attributes: Dict[str, Any]) -> None: ...
6261
@property
6362
def critical(self) -> bool: ...
6463
@property
65-
def tags(self) -> List[Text]: ...
64+
def tags(self) -> List[str]: ...
6665
@property
67-
def source(self) -> Text: ...
66+
def source(self) -> str: ...
6867
@property
69-
def code_ref(self) -> Text: ...
68+
def code_ref(self) -> str: ...
7069
@property
71-
def test_case_id(self) -> Optional[Text]: ...
72-
def update(self, attributes: Dict[Text, Any]) -> Test: ...
70+
def test_case_id(self) -> Optional[str]: ...
71+
def update(self, attributes: Dict[str, Any]) -> Test: ...
7372

7473
class Keyword:
75-
attributes: Dict[Text, Any] = ...
76-
args: List[Text] = ...
77-
assign: List[Text] = ...
78-
doc: Text = ...
79-
end_time: Text = ...
80-
keyword_name: Text = ...
81-
keyword_type: Text = ...
82-
libname: Text = ...
83-
name: Text = ...
84-
rp_item_id: Optional[Text] = ...
85-
rp_parent_item_id: Optional[Text] = ...
86-
parent_type: Text = ...
87-
start_time: Text = ...
88-
status: Text = ...
89-
tags: List[Text] = ...
90-
type: Text = 'KEYWORD'
91-
def __init__(self, name: Text, attributes: Dict[Text, Any], parent_type: Optional[Text] = None) -> None: ...
92-
def get_name(self) -> Text: ...
93-
def get_type(self) -> Text: ...
94-
def update(self, attributes: Dict[Text, Any]) -> Keyword: ...
74+
attributes: Dict[str, Any] = ...
75+
args: List[str] = ...
76+
assign: List[str] = ...
77+
doc: str = ...
78+
end_time: str = ...
79+
keyword_name: str = ...
80+
keyword_type: str = ...
81+
libname: str = ...
82+
name: str = ...
83+
rp_item_id: Optional[str] = ...
84+
rp_parent_item_id: Optional[str] = ...
85+
parent_type: str = ...
86+
start_time: str = ...
87+
status: str = ...
88+
tags: List[str] = ...
89+
type: str = 'KEYWORD'
90+
def __init__(self, name: str, attributes: Dict[str, Any], parent_type: Optional[str] = None) -> None: ...
91+
def get_name(self) -> str: ...
92+
def get_type(self) -> str: ...
93+
def update(self, attributes: Dict[str, Any]) -> Keyword: ...
9594

96-
class LogMessage(text_type):
97-
attachment: Optional[Dict[Text, Text]] = ...
95+
class LogMessage(str):
96+
attachment: Optional[Dict[str, str]] = ...
9897
launch_log: bool = ...
99-
item_id: Optional[Text] = ...
100-
level: Text = ...
101-
message: Text = ...
98+
item_id: Optional[str] = ...
99+
level: str = ...
100+
message: str = ...
102101
def __init__(self, *args: Tuple, **kwargs: Dict) -> None: ...

robotframework_reportportal/result_visitor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from datetime import datetime
1818

1919
from robot.api import ResultVisitor
20-
from six.moves.urllib.parse import unquote
20+
from urllib.parse import unquote
2121

2222
from . import listener
2323
from .time_visitor import corrections

0 commit comments

Comments
 (0)