Skip to content

Commit fa71204

Browse files
authored
Merge pull request #144 from reportportal/develop
Release
2 parents 62ed7cc + e66a6bd commit fa71204

19 files changed

+272
-36
lines changed

.github/workflows/release.yml

Lines changed: 105 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,113 @@
11
name: Release RobotFramework agent
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches: [ 'master' ]
6+
paths-ignore:
7+
- '.github/**'
8+
- CHANGELOG.md
9+
- README.rst
10+
- CONTRIBUTING.rst
11+
12+
env:
13+
VERSION_FILE: setup.py
14+
VERSION_EXTRACT_PATTERN: >-
15+
__version__\s*=\s*'([^']+)
16+
VERSION_REPLACE_PATTERN: >-
17+
__version__ = '\1'
18+
TMP_SUFFIX: _updated
19+
CHANGE_LOG_FILE: CHANGELOG.md
620

721
jobs:
822
deploy:
923
runs-on: ubuntu-latest
1024
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v2
14-
with:
15-
python-version: '3.6'
16-
- name: Install dependencies
17-
run: python -m pip install --upgrade pip setuptools wheel
18-
- name: Build package
19-
run: python setup.py sdist bdist_wheel
20-
- name: Publish package
21-
uses: pypa/gh-action-pypi-publish@release/v1
22-
with:
23-
user: ${{ secrets.PYPI_USERNAME }}
24-
password: ${{ secrets.PYPI_PASSWORD }}
25+
- uses: actions/checkout@v2
26+
27+
- name: Generate versions
28+
uses: HardNorth/[email protected]
29+
with:
30+
version-source: file
31+
version-file: ${{ env.VERSION_FILE }}
32+
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}
33+
34+
- name: Setup git credentials
35+
uses: oleksiyrudenko/gha-git-credentials@v2
36+
with:
37+
name: 'reportportal.io'
38+
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
41+
- name: Tagging new version
42+
id: newVersionTag
43+
run: |
44+
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
45+
git push --tags
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v2
49+
with:
50+
python-version: '3.6'
51+
52+
- name: Install dependencies
53+
run: python -m pip install --upgrade pip setuptools wheel
54+
55+
- name: Build package
56+
run: python setup.py sdist bdist_wheel
57+
58+
- name: Publish package
59+
uses: pypa/gh-action-pypi-publish@release/v1
60+
with:
61+
user: ${{ secrets.PYPI_USERNAME }}
62+
password: ${{ secrets.PYPI_PASSWORD }}
63+
64+
- name: Update CHANGELOG.md
65+
id: changelogUpdate
66+
run: |
67+
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
68+
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
69+
{ echo -e '\n## [${{ env.RELEASE_VERSION }}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
70+
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
71+
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
72+
rm ${{ env.CHANGE_LOG_FILE }}
73+
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
74+
git add ${{ env.CHANGE_LOG_FILE }}
75+
git commit -m "Changelog update"
76+
77+
- name: Read changelog Entry
78+
id: readChangelogEntry
79+
uses: mindsers/[email protected]
80+
with:
81+
version: ${{ env.RELEASE_VERSION }}
82+
path: ./${{ env.CHANGE_LOG_FILE }}
83+
84+
- name: Create Release
85+
id: createRelease
86+
uses: actions/create-release@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
tag_name: ${{ env.RELEASE_VERSION }}
91+
release_name: Release ${{ env.RELEASE_VERSION }}
92+
body: ${{ steps.readChangelogEntry.outputs.log_entry }}
93+
draft: false
94+
prerelease: false
95+
96+
- name: Merge release branch into develop
97+
id: mergeIntoDevelop
98+
run: |
99+
git merge -m 'Merge master branch into develop after a release' origin/master
100+
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
101+
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
102+
103+
- name: Update version file
104+
id: versionFileUpdate
105+
run: |
106+
export CURRENT_VERSION_VALUE=`echo '${{ env.CURRENT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
107+
export NEXT_VERSION_VALUE=`echo '${{ env.NEXT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
108+
sed "s/${CURRENT_VERSION_VALUE}/${NEXT_VERSION_VALUE}/g" ${{ env.VERSION_FILE }} > ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }}
109+
rm ${{ env.VERSION_FILE }}
110+
mv ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }} ${{ env.VERSION_FILE }}
111+
git add ${{ env.VERSION_FILE }}
112+
git commit -m 'Version update'
113+
git push

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
10+
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, '3.10']
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: Set up Python ${{ matrix.python-version }}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
## [Unreleased]
4+
### Fixed
5+
- Issue [#140](https://github.com/reportportal/agent-Python-RobotFramework/issues/140) Process test message at the end of the test, by @iivanou
6+
- Issue [#139](https://github.com/reportportal/agent-Python-RobotFramework/issues/139) Broken view in Before/After Suites items, by @HardNorth
7+
8+
## [5.2.1]
9+
### Added
10+
- Support of the rerun functionality;
11+
- Allow attaching log and xunit result files to the launch;
12+
- Add the ability to disable SSL verification.
13+
### Fixed
14+
- SKIP message handling.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*** Settings ***
2+
Suite Teardown Log suite tear down
3+
4+
*** Test Cases ***
5+
My first test
6+
Log My first test
7+
8+
*** Keywords ***
9+
Log suite tear down
10+
Log Suite tear down step
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*** Settings ***
2+
Suite Setup Log suite setup
3+
4+
*** Test Cases ***
5+
My first test
6+
Log My first test
7+
8+
*** Keywords ***
9+
Log suite setup
10+
Log Suite setup step

examples/no_keywords.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*** Test Cases ***
2+
No keyword test case

robotframework_reportportal/listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""This module includes Robot Framework listener interfaces..
22
3-
Copyright (c) 2021 http://reportportal.io .
3+
Copyright (c) 2021 https://reportportal.io .
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
7-
http://www.apache.org/licenses/LICENSE-2.0
7+
https://www.apache.org/licenses/LICENSE-2.0
88
Unless required by applicable law or agreed to in writing, software
99
distributed under the License is distributed on an "AS IS" BASIS,
1010
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

robotframework_reportportal/service.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""This module includes Robot service for reporting results to Report Portal.
22
3-
Copyright (c) 2021 http://reportportal.io .
3+
Copyright (c) 2021 https://reportportal.io .
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
7-
http://www.apache.org/licenses/LICENSE-2.0
7+
https://www.apache.org/licenses/LICENSE-2.0
88
Unless required by applicable law or agreed to in writing, software
99
distributed under the License is distributed on an "AS IS" BASIS,
1010
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,6 +30,8 @@
3030

3131
logger = logging.getLogger(__name__)
3232

33+
TOP_LEVEL_ITEMS = {'BEFORE_SUITE', 'AFTER_SUITE'}
34+
3335

3436
def to_epoch(date):
3537
"""Convert Robot Framework timestamp to UTC timestamp."""
@@ -230,7 +232,7 @@ def start_keyword(self, keyword, ts=None):
230232
"""
231233
start_rq = {
232234
'description': keyword.doc,
233-
'has_stats': False,
235+
'has_stats': keyword.get_type() in TOP_LEVEL_ITEMS,
234236
'item_type': keyword.get_type(),
235237
'name': keyword.get_name(),
236238
'parent_item_id': keyword.rp_parent_item_id,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from setuptools import setup, find_packages
55

66

7-
__version__ = '5.2.1'
7+
__version__ = '5.2.2'
88

99

1010
def read_file(fname):

tests/helpers/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
See the License for the specific language governing permissions and
1414
limitations under the License
1515
"""
16+
import time
17+
import random
1618

1719
from robot.run import RobotFramework
1820

@@ -47,3 +49,8 @@ def run_robot_tests(tests, listener='robotframework_reportportal.listener',
4749
def get_launch_log_calls(mock):
4850
return [e for e in mock.log.call_args_list
4951
if 'item_id' in e[1] and e[1]['item_id'] is None]
52+
53+
54+
def item_id_gen(**kwargs):
55+
return "{}-{}-{}".format(kwargs['name'], str(round(time.time() * 1000)),
56+
random.randint(0, 9999))

0 commit comments

Comments
 (0)