File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,19 @@ def pytest_addoption(parser):
1111 action = "store" ,
1212 type = str ,
1313 help = "Directory where tests can store artifacts" )
14+ parser .addoption (
15+ "--machine-target" ,
16+ action = "store" ,
17+ type = str ,
18+ default = None ,
19+ help =
20+ "Target node name assigned when triggered remotely by the orchestrator. Internal parameter used by protoplaster; do not set manually."
21+ )
1422
1523
1624@pytest .fixture (scope = 'class' , autouse = True )
1725def setup_tests (yaml_file , request ):
26+ request .cls .machine_target = request .config .getoption ("--machine-target" )
1827 arg_name = request .cls .module_name ()
1928 if arg_name in yaml_file :
2029 conf = yaml_file [arg_name ].pop (0 )
Original file line number Diff line number Diff line change @@ -187,6 +187,10 @@ def prepare_pytest_args(test_paths, args):
187187 pytest_args += f"--junitxml={ args .output } "
188188 if args .artifacts_dir :
189189 pytest_args += f"--artifacts-dir={ args .artifacts_dir } "
190+
191+ if getattr (args , 'machine_target' , None ):
192+ pytest_args += f"--machine-target={ args .machine_target } "
193+
190194 links_to_tests = create_links_to_tests (test_paths )
191195
192196 test_to_run = ""
You can’t perform that action at this time.
0 commit comments