Skip to content

Commit 76afa1d

Browse files
authored
Merge pull request #336 from reportportal/develop
Release
2 parents 78b893a + d8ae0aa commit 76afa1d

File tree

12 files changed

+139
-102
lines changed

12 files changed

+139
-102
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ jobs:
7575
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
7676
git push --tags
7777
78+
- name: Checkout develop branch
79+
uses: actions/checkout@v3
80+
with:
81+
ref: 'develop'
82+
fetch-depth: 0
83+
84+
- name: Merge release branch into develop
85+
id: mergeIntoDevelop
86+
run: |
87+
git merge -m 'Merge master branch into develop after a release' origin/master
88+
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
89+
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
90+
7891
- name: Update CHANGELOG.md
7992
id: changelogUpdate
8093
run: |
@@ -87,7 +100,6 @@ jobs:
87100
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
88101
git add ${{ env.CHANGE_LOG_FILE }}
89102
git commit -m "Changelog update"
90-
git push
91103
92104
- name: Read changelog Entry
93105
id: readChangelogEntry
@@ -104,19 +116,6 @@ jobs:
104116
name: Release ${{ env.RELEASE_VERSION }}
105117
body: ${{ steps.readChangelogEntry.outputs.changes }}
106118

107-
- name: Checkout develop branch
108-
uses: actions/checkout@v3
109-
with:
110-
ref: 'develop'
111-
fetch-depth: 0
112-
113-
- name: Merge release branch into develop
114-
id: mergeIntoDevelop
115-
run: |
116-
git merge -m 'Merge master branch into develop after a release' origin/master
117-
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
118-
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
119-
120119
- name: Update version file
121120
id: versionFileUpdate
122121
run: |

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Plugin Exception in case of Launch creation timed out, by @HardNorth
6+
### Changed
7+
- Client version updated on [5.3.1](https://github.com/reportportal/client-Python/releases/tag/5.3.1), by @HardNorth
8+
9+
## [5.1.6]
10+
### Changed
11+
- Client version updated on [5.3.0](https://github.com/reportportal/client-Python/releases/tag/5.3.0), by @HardNorth
412

513
## [5.1.5]
614
### Added

README.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Pytest plugin for reporting test results of the Pytest to the Report Portal.
2424
* Usage
2525
* Installation
2626
* Configuration
27-
* Contribution
2827
* Examples
2928
* Launching
3029
* Send attachment (screenshots)
@@ -44,21 +43,7 @@ To install pytest plugin execute next command in a terminal:
4443
4544
pip install pytest-reportportal
4645
47-
**IMPORTANT!**
48-
The latest version **does not** support Report Portal versions below 5.0.0.
4946
50-
Specify the last one release of the client version 1 to install or update the client for other versions of Report Portal below 5.0.0:
51-
52-
.. code-block:: bash
53-
54-
pip install pytest-reportportal~=1.0
55-
56-
57-
Contribution
58-
~~~~~~~~~~~~~
59-
60-
All the fixes for the agent that supports Report Portal versions below 5.0.0 should go into the v1 branch.
61-
The master branch will store the code base for the agent for Report Portal versions 5 and above.
6247
6348
Look through the CONTRIBUTING.rst for contribution guidelines.
6449

@@ -257,11 +242,11 @@ deactivate :code:`pytest_reportportal` plugin with command like:
257242
py.test -p no:pytest_reportportal ./tests
258243
259244
260-
Integration with GA
261-
-------------------
245+
Integration with Google analytics
246+
---------------------------------
262247
ReportPortal is now supporting integrations with more than 15 test frameworks simultaneously. In order to define the most popular agents and plan the team workload accordingly, we are using Google analytics.
263248

264-
ReportPortal collects information about agent name and its version only. This information is sent to Google analytics on the launch start. Please help us to make our work effective.
249+
ReportPortal collects information about agent name and its version only. This information is sent to Google Analytics on the launch start. Please help us to make our work effective.
265250
If you still want to switch Off Google analytics, please change env variable the way below.
266251

267252
.. code-block:: bash

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ requires = [
33
# sync with setup.py until we discard non-pep-517/518
44
"setuptools>=40.0",
55
"setuptools-scm",
6-
"wheel",
6+
"wheel==0.37.1",
77
]
88
build-backend = "setuptools.build_meta"

pytest_reportportal/config.pyi

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ from _pytest.config import Config as Config
22
from typing import List, Optional, Text, Union, Any
33

44
class AgentConfig:
5-
rp_rerun: Optional[bool] = ...
6-
pconfig: Config = ...
7-
rp_endpoint: Text = ...
8-
rp_hierarchy_code: bool = ...
9-
rp_dir_level: int = ...
10-
rp_hierarchy_dirs: bool = ...
11-
rp_dir_path_separator: Text = ...
12-
rp_ignore_attributes: set = ...
13-
rp_is_skipped_an_issue: bool = ...
14-
rp_issue_id_marks: bool = ...
15-
rp_issue_system_url: Text = ...
16-
rp_bts_project: Text = ...
17-
rp_bts_url: Text = ...
18-
rp_launch: Text = ...
19-
rp_launch_id: Optional[Text] = ...
20-
rp_launch_attributes: Optional[List] = ...
21-
rp_launch_description: Text = ...
22-
rp_log_batch_size: int = ...
23-
rp_log_batch_payload_size: int = ...
24-
rp_log_level: Optional[int] = ...
25-
rp_log_format: Optional[Text] = ...
26-
rp_mode: Text = ...
27-
rp_parent_item_id: Optional[Text] = ...
28-
rp_project: Text = ...
29-
rp_rerun_of: Optional[Text] = ...
30-
rp_retries: int = ...
31-
rp_skip_connection_test: bool = ...
32-
rp_uuid: Text = ...
33-
rp_verify_ssl: Union[bool, Text] = ...
34-
rp_launch_timeout: int = ...
5+
rp_rerun: Optional[bool]
6+
pconfig: Config
7+
rp_endpoint: Text
8+
rp_hierarchy_code: bool
9+
rp_dir_level: int
10+
rp_hierarchy_dirs: bool
11+
rp_dir_path_separator: Text
12+
rp_ignore_attributes: set
13+
rp_is_skipped_an_issue: bool
14+
rp_issue_id_marks: bool
15+
rp_issue_system_url: Text
16+
rp_bts_project: Text
17+
rp_bts_url: Text
18+
rp_launch: Text
19+
rp_launch_id: Optional[Text]
20+
rp_launch_attributes: Optional[List]
21+
rp_launch_description: Text
22+
rp_log_batch_size: int
23+
rp_log_batch_payload_size: int
24+
rp_log_level: Optional[int]
25+
rp_log_format: Optional[Text]
26+
rp_mode: Text
27+
rp_parent_item_id: Optional[Text]
28+
rp_project: Text
29+
rp_rerun_of: Optional[Text]
30+
rp_retries: int
31+
rp_skip_connection_test: bool
32+
rp_uuid: Text
33+
rp_verify_ssl: Union[bool, Text]
34+
rp_launch_timeout: int
3535

3636
def __init__(self, pytest_config: Config) -> None: ...
3737

pytest_reportportal/plugin.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
"""This module contains changed pytest for report-portal."""
22

3+
# Copyright (c) 2023 https://reportportal.io .
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License
15+
316
import logging
4-
# This program is free software: you can redistribute it
5-
# and/or modify it under the terms of the GPL licence
617
import os.path
718
import time
819

@@ -27,6 +38,10 @@
2738
'rp_endpoint: {}, ' + \
2839
'rp_uuid: {}'
2940

41+
FAILED_LAUNCH_WAIT = 'Failed to initialize reportportal-client service. ' \
42+
+ 'Waiting for Launch start timed out. ' \
43+
+ 'Reporting is disabled.'
44+
3045

3146
@pytest.mark.optionalhook
3247
def pytest_configure_node(node):
@@ -59,8 +74,9 @@ def wait_launch(rp_client):
5974
timeout = time.time() + LAUNCH_WAIT_TIMEOUT
6075
while not rp_client.launch_id:
6176
if time.time() > timeout:
62-
raise Exception("Launch has not started.")
77+
return False
6378
time.sleep(1)
79+
return True
6480

6581

6682
# noinspection PyProtectedMember
@@ -90,7 +106,10 @@ def pytest_sessionstart(session):
90106
config.py_test_service.start_launch()
91107
if config.pluginmanager.hasplugin('xdist') \
92108
or config.pluginmanager.hasplugin('pytest-parallel'):
93-
wait_launch(session.config.py_test_service.rp)
109+
if not wait_launch(session.config.py_test_service.rp):
110+
log.error(FAILED_LAUNCH_WAIT)
111+
config.py_test_service.rp = None
112+
config._rp_enabled = False
94113

95114

96115
def pytest_collection_finish(session):

pytest_reportportal/plugin.pyi

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ from typing import Text
44
import pytest
55

66
from .config import AgentConfig
7-
from .service import PyTestServiceClass as PyTestServiceClass
8-
from _pytest.config import Config as Config
9-
from _pytest.config.argparsing import Parser as Parser
10-
from _pytest.main import Session as Session
11-
from pytest_reportportal import LAUNCH_WAIT_TIMEOUT as LAUNCH_WAIT_TIMEOUT
12-
from reportportal_client.service import ReportPortalService as ReportPortalService
13-
from xdist.workermanage import WorkerController as WorkerController
7+
from _pytest.config import Config
8+
from _pytest.config.argparsing import Parser
9+
from _pytest.main import Session
10+
from reportportal_client import RPClient
11+
from xdist.workermanage import WorkerController
1412

1513
log: Logger
1614
MANDATORY_PARAMETER_MISSED_PATTERN: Text
15+
FAILED_LAUNCH_WAIT: Text
1716

1817
def check_connection(agent_config: AgentConfig) -> bool: ...
1918
def is_control(config: Config) -> bool: ...
20-
def wait_launch(rp_client: ReportPortalService) -> None: ...
19+
def wait_launch(rp_client: RPClient) -> bool: ...
2120
def pytest_configure_node(node: WorkerController) -> None: ...
2221
def pytest_sessionstart(session: Session) -> None: ...
2322
def pytest_collection_finish(session: Session) -> None: ...

pytest_reportportal/service.pyi

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ from .config import AgentConfig
1515
from typing import List, Dict, Text, Any, Tuple, Set, Optional
1616
from pytest import Item
1717
from threading import Lock
18-
from reportportal_client.client import RPClient
18+
from reportportal_client import RPClient
1919

2020
class PyTestServiceClass:
2121

22-
_config: AgentConfig = ...
23-
_issue_types: Dict[Text, Text] = ...
24-
_tree_path: Dict[Item, List[Dict[Text, Any]]] = ...
25-
_log_levels: Tuple = ...
26-
_skip_analytics: Text = ...
27-
_start_tracker: Set[Text] = ...
28-
_process_level_lock: Lock = ...
29-
_launch_id: Optional[Text] = ...
30-
agent_name: Text = ...
31-
agent_version: Text = ...
32-
ignored_attributes: List[Text] = ...
33-
log_batch_size: int = ...
34-
parent_item_id: Optional[Text] = ...
35-
rp: Optional[RPClient] = ...
36-
project_settings: Dict[Text, Any] = ...
22+
_config: AgentConfig
23+
_issue_types: Dict[Text, Text]
24+
_tree_path: Dict[Item, List[Dict[Text, Any]]]
25+
_log_levels: Tuple
26+
_skip_analytics: Text
27+
_start_tracker: Set[Text]
28+
_process_level_lock: Lock
29+
_launch_id: Optional[Text]
30+
agent_name: Text
31+
agent_version: Text
32+
ignored_attributes: List[Text]
33+
log_batch_size: int
34+
parent_item_id: Optional[Text]
35+
rp: Optional[RPClient]
36+
project_settings: Dict[Text, Any]
3737

3838
def __init__(self, agent_config: AgentConfig) -> None: ...
3939
def start(self) -> None: ...

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dill>=0.2.7.1
22
pytest>=3.8.0
3-
reportportal-client==5.3.0
3+
reportportal-client==5.3.1
44
six>=1.15.0
55
aenum>=3.1.0
66
requests

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
test=pytest
33

44
[metadata]
5-
description-file = README.rst
5+
description_file = README.rst
66

77
[sdist]
88
formats=gztar

0 commit comments

Comments
 (0)