Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/24-1
Browse files Browse the repository at this point in the history
  • Loading branch information
avarabyeu authored Apr 10, 2018
2 parents 59befba + cfe7030 commit 897d6eb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ test = service.start_test_item(name="Test Case",
description="First Test Case",
tags=["Image", "Smoke"],
start_time=timestamp(),
item_type="STEP")
item_type="STEP",
parameters={"key1": "val1",
"key2": "val2"})

# Create text log message with INFO level.
service.log(time=timestamp(),
Expand Down
14 changes: 13 additions & 1 deletion reportportal_client/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,31 @@ def stop_launch(self, end_time, status=None):
status=status)

def start_test_item(self, name, start_time, item_type, description=None,
tags=None):
tags=None, parameters=None):
"""
item_type can be (SUITE, STORY, TEST, SCENARIO, STEP, BEFORE_CLASS,
BEFORE_GROUPS, BEFORE_METHOD, BEFORE_SUITE, BEFORE_TEST, AFTER_CLASS,
AFTER_GROUPS, AFTER_METHOD, AFTER_SUITE, AFTER_TEST)
parameters should be a dictionary with the following format:
{
"<key1>": "<value1>",
"<key2>": "<value2>",
...
}
"""
if parameters is not None:
parameters = [{"key": key, "value": str(value)}
for key, value in parameters.items()]

data = {
"name": name,
"description": description,
"tags": tags,
"start_time": start_time,
"launch_id": self.launch_id,
"type": item_type,
"parameters": parameters,
}
parent_item_id = self.stack[-1]
if parent_item_id is not None:
Expand Down
3 changes: 2 additions & 1 deletion reportportal_client/service_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def stop_launch(self, end_time, status=None):
self.queue.put_nowait(("stop_launch", args))

def start_test_item(self, name, start_time, item_type, description=None,
tags=None):
tags=None, parameters=None):
logger.debug("start_test_item queued")

args = {
Expand All @@ -250,6 +250,7 @@ def start_test_item(self, name, start_time, item_type, description=None,
"tags": tags,
"start_time": start_time,
"item_type": item_type,
"parameters": parameters,
}
self.queue.put_nowait(("start_test_item", args))

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
setup(
name='reportportal-client',
packages=find_packages(),
version='3.1.0',
version='3.2.0',
description='Python client for Report Portal',
author='Artsiom Tkachou',
author_email='[email protected]',
url='https://github.com/reportportal/client-Python',
download_url='https://github.com/reportportal/client-Python/tarball/3.0.0',
download_url='https://github.com/reportportal/client-Python/tarball/3.2.0',
license='GNU General Public License v3',
keywords=['testing', 'reporting', 'reportportal'],
classifiers=[],
Expand Down

0 comments on commit 897d6eb

Please sign in to comment.