Skip to content

Commit 2bb14bb

Browse files
authored
Merge pull request #411 from fahadnaeemkhan/add_rp_attrs
added --rp-launch-attributes and --rp-tests-attributes CLI args
2 parents 8f46b4b + 72129cc commit 2bb14bb

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

pytest_reportportal/plugin.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,18 @@ def add_shared_option(name, help_str, default=None, action="store"):
594594
parser.addini("rp_oauth_client_secret", type="args", help="OAuth 2.0 client secret")
595595
parser.addini("rp_oauth_scope", type="args", help="OAuth 2.0 access token scope")
596596

597-
parser.addini("rp_launch_attributes", type="args", help="Launch attributes, i.e Performance Regression")
598-
parser.addini("rp_tests_attributes", type="args", help="Attributes for all tests items, e.g. Smoke")
597+
rp_launch_attributes_help_str = "Launch attributes, i.e Performance Regression."
598+
parser.addini("rp_launch_attributes", type="args", help=rp_launch_attributes_help_str)
599+
group.addoption(
600+
"--rp-launch-attributes", dest="rp_launch_attributes", help=rp_launch_attributes_help_str, nargs="+"
601+
)
602+
603+
rp_test_attributes_help_str = "Attributes for all tests items, e.g. Smoke."
604+
parser.addini("rp_tests_attributes", type="args", help=rp_test_attributes_help_str)
605+
group.addoption(
606+
"--rp-tests-attributes", dest="rp_tests_attributes", help=rp_test_attributes_help_str, nargs="+"
607+
)
608+
599609
parser.addini("rp_log_batch_size", default="20", help="Size of batch log requests in async mode")
600610
parser.addini(
601611
"rp_log_batch_payload_limit",

tests/unit/test_plugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ def test_pytest_addoption_adds_correct_command_line_arguments():
308308
"--rp-thread-logging",
309309
"--rp-launch-uuid-print",
310310
"--rp-launch-uuid-print-output",
311+
'--rp-launch-attributes',
312+
'--rp-tests-attributes'
311313
)
312314
mock_parser = mock.MagicMock(spec=Parser)
313315
mock_reporting_group = mock_parser.getgroup.return_value

0 commit comments

Comments
 (0)