Skip to content

Commit 85a7ce0

Browse files
authored
Merge pull request #286 from reportportal/suite-path-fix
Suite path fix
2 parents f0b6ace + fb392e1 commit 85a7ce0

File tree

17 files changed

+323
-80
lines changed

17 files changed

+323
-80
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ repos:
1212
rev: 6.0.0
1313
hooks:
1414
- id: pydocstyle
15+
exclude: |
16+
(?x)^(
17+
tests/.* |
18+
examples/.*
19+
)
1520
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
1621
rev: v1.0.1
1722
hooks:

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ The following parameters are optional:
113113
- :code:`rp_issue_system_url = http://bugzilla.some.com/show_bug.cgi?id={%issue_id}` - issue URL (issue_id will be filled by parameter from pytest mark)
114114
- :code:`rp_issue_id_marks = True` - Enables adding marks for issue ids (e.g. "issue:123456")
115115
- :code:`rp_verify_ssl = True` - Verify SSL when connecting to the server
116-
- :code:`rp_display_suite_test_file = True` In case of True, include the suite's relative file path in the launch name as a convention of "<RELATIVE_FILE_PATH>::<SUITE_NAME>". In case of False, set the launch name to be the suite name only - this flag is relevant only when "rp_hierarchy_module" flag is set to False
116+
- :code:`rp_display_suite_test_file = True` - In case of True, include the suite's relative file path in the launch name as a convention of "<RELATIVE_FILE_PATH>::<SUITE_NAME>". In case of False, set the launch name to be the suite name only - this flag is relevant only when "rp_hierarchy_module" flag is set to False
117+
- :code:`rp_mode = DEFAULT` - DEBUG or DEFAULT launch mode. DEBUG launches are displayed in a separate tab and not visible to anyone except owner
118+
- :code:`rp_hierarchy_dir_path_separator` - Path separator to display directories in test hierarchy. In case of empty value current system path separator will be used
117119

118120

119121
If you like to override the above parameters from command line, or from CI environment based on your build, then pass
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Simple example test."""
2+
3+
4+
def test_simple():
5+
"""Simple example test."""
6+
assert True
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Simple example test."""
2+
3+
4+
def test_simple():
5+
"""Simple example test."""
6+
assert True
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""A simple example test in a class."""
2+
3+
4+
class Tests:
5+
def test_in_class(self):
6+
"""
7+
This is my test inside `Tests` class
8+
"""
9+
assert True
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""A simple example test in a class in a class."""
2+
3+
4+
class Tests:
5+
class Test:
6+
def test_in_class_in_class(self):
7+
"""
8+
This is my test inside `Test` class
9+
"""
10+
assert True
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"""A simple example test in a class with a parameter."""
2+
import pytest
3+
4+
5+
class Tests:
6+
7+
@pytest.mark.parametrize('param', ['param'])
8+
def test_in_class_parameterized(self, param):
9+
"""
10+
This is my test inside `Tests` class with a parameter
11+
"""
12+
assert True

pytest_reportportal/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def __init__(self, pytest_config):
1919
self.pconfig = pytest_config
2020

2121
self.rp_endpoint = self.find_option('rp_endpoint')
22+
self.rp_hierarchy_dir_path_separator = self.find_option(
23+
'rp_hierarchy_dir_path_separator')
2224
self.rp_ignore_errors = self.find_option('rp_ignore_errors')
2325
self.rp_ignore_attributes = self.find_option('rp_ignore_attributes')
2426
self.rp_is_skipped_an_issue = self.find_option(

pytest_reportportal/config.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class AgentConfig:
55
_rp_rerun: Optional[bool] = ...
66
pconfig: Config = ...
77
rp_endpoint: Text = ...
8+
rp_hierarchy_dir_path_separator: Text = ...
89
rp_ignore_errors: bool = ...
910
rp_ignore_attributes: Optional[List] = ...
1011
rp_is_skipped_an_issue: bool = ...
@@ -14,13 +15,14 @@ class AgentConfig:
1415
rp_launch_description: Text = ...
1516
rp_log_batch_size: int = ...
1617
rp_log_level: Optional[int] = ...
18+
rp_mode: str = ...
1719
rp_parent_item_id: Optional[Text] = ...
1820
rp_project: Text = ...
1921
rp_rerun_of: Optional[Text] = ...
2022
rp_retries: int = ...
2123
rp_uuid: Text = ...
2224
rp_verify_ssl: bool = ...
23-
rp_mode: str = ...
25+
2426
def __init__(self, pytest_config: Config) -> None: ...
2527
@property
2628
def rp_rerun(self) -> Optional[bool]: ...

pytest_reportportal/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,3 +378,7 @@ def add_shared_option(name, help, default=None, action='store'):
378378
'retries',
379379
default='0',
380380
help='Amount of retries for performing REST calls to RP server')
381+
parser.addini(
382+
'rp_hierarchy_dir_path_separator',
383+
default='',
384+
help='Path separator to display directories in test hierarchy')

0 commit comments

Comments
 (0)