Skip to content

Commit ddecb75

Browse files
pkoscikdolszewski-antmicro
authored andcommitted
[#91314] Add initial machine_target detection
1 parent 0ca9376 commit ddecb75

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

protoplaster/conf/params_conf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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)
1725
def 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)

protoplaster/runner/runner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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 = ""

0 commit comments

Comments
 (0)