From 30ab9bfb4d5c75450ae5353f8b8fc60c3150a9f7 Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Tue, 23 Dec 2025 10:48:39 -0600 Subject: [PATCH 1/3] Initial changes to add support for user-specified process managers --- src/integrationtest/data_classes.py | 5 +++++ src/integrationtest/integrationtest_drunc.py | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/integrationtest/data_classes.py b/src/integrationtest/data_classes.py index 2b1ad5c..d793d3f 100755 --- a/src/integrationtest/data_classes.py +++ b/src/integrationtest/data_classes.py @@ -77,3 +77,8 @@ class CreateConfigResult: data_dirs: list[str] tpstream_data_dirs: list[str] trmon_data_dirs: list[str] + + +@dataclass +class ProcessManagerChoice: + pm_type: str diff --git a/src/integrationtest/integrationtest_drunc.py b/src/integrationtest/integrationtest_drunc.py index 9420233..ca75066 100755 --- a/src/integrationtest/integrationtest_drunc.py +++ b/src/integrationtest/integrationtest_drunc.py @@ -8,6 +8,7 @@ from integrationtest.integrationtest_commandline import file_exists from integrationtest.data_classes import ( CreateConfigResult, + ProcessManagerChoice, config_substitution, attribute_substitution, relationship_substitution, @@ -70,10 +71,23 @@ def pytest_generate_tests(metafunc): # and parametrize the fixtures here in pytest_generate_tests, # which is run at pytest startup + # provide default process manager choice + if not hasattr(metafunc.module, "process_manager_choices"): + print(metafunc.module) + metafunc.module.process_manager_choices = { "StandAloneSSH_PM" : {"pm_type": "ssh-standalone"} } + parametrize_fixture_with_items(metafunc, "create_config_files", "confgen_arguments") + parametrize_fixture_with_items(metafunc, "process_manager_type", "process_manager_choices") parametrize_fixture_with_items(metafunc, "run_nanorc", "nanorc_command_list") +@pytest.fixture(scope="module") +def process_manager_type(request, tmp_path_factory): + result = ProcessManagerChoice ( + pm_type = request.param["pm_type"] + ) + yield result + @pytest.fixture(scope="module") def create_config_files(request, tmp_path_factory): """Run the confgen to produce the configuration json files @@ -294,7 +308,7 @@ def apply_update(obj, substitution): @pytest.fixture(scope="module") -def run_nanorc(request, create_config_files, tmp_path_factory): +def run_nanorc(request, create_config_files, process_manager_type, tmp_path_factory): """Run nanorc with the OKS DB files created by `create_config_files`. The commands specified by the `nanorc_command_list` variable in the test module are executed. If `nanorc_command_list`'s items are @@ -435,7 +449,7 @@ class RunResult: result.completed_process = subprocess.run( [nanorc] + nanorc_option_strings - + [str("ssh-standalone")] + + [str(process_manager_type.pm_type)] + [str(create_config_files.config_file)] + [str(create_config_files.config.session)] + [str(create_config_files.config.session_name if create_config_files.config.session_name else create_config_files.config.session)] From 1596210a981f7b4b3a9a028c4c59cbc67cfcbd40 Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Mon, 29 Dec 2025 08:15:16 -0600 Subject: [PATCH 2/3] removed debug print statement for process_manager_choices in integrationtest_drunc.py --- src/integrationtest/integrationtest_drunc.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/integrationtest/integrationtest_drunc.py b/src/integrationtest/integrationtest_drunc.py index ca75066..a1beb57 100755 --- a/src/integrationtest/integrationtest_drunc.py +++ b/src/integrationtest/integrationtest_drunc.py @@ -73,7 +73,6 @@ def pytest_generate_tests(metafunc): # provide default process manager choice if not hasattr(metafunc.module, "process_manager_choices"): - print(metafunc.module) metafunc.module.process_manager_choices = { "StandAloneSSH_PM" : {"pm_type": "ssh-standalone"} } parametrize_fixture_with_items(metafunc, "create_config_files", "confgen_arguments") From dcdbb19980125fa38062631479ad79b9f3acefaa Mon Sep 17 00:00:00 2001 From: Kurt Biery Date: Mon, 29 Dec 2025 09:00:44 -0600 Subject: [PATCH 3/3] Added comments for process-manager-choice changes --- src/integrationtest/data_classes.py | 1 + src/integrationtest/integrationtest_drunc.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/integrationtest/data_classes.py b/src/integrationtest/data_classes.py index d793d3f..dc47dae 100755 --- a/src/integrationtest/data_classes.py +++ b/src/integrationtest/data_classes.py @@ -79,6 +79,7 @@ class CreateConfigResult: trmon_data_dirs: list[str] +# 29-Dec-2025, KAB: added support for different run control process managers @dataclass class ProcessManagerChoice: pm_type: str diff --git a/src/integrationtest/integrationtest_drunc.py b/src/integrationtest/integrationtest_drunc.py index a1beb57..97462a3 100755 --- a/src/integrationtest/integrationtest_drunc.py +++ b/src/integrationtest/integrationtest_drunc.py @@ -71,7 +71,7 @@ def pytest_generate_tests(metafunc): # and parametrize the fixtures here in pytest_generate_tests, # which is run at pytest startup - # provide default process manager choice + # 29-Dec-2025, KAB: added default process manager choice if not hasattr(metafunc.module, "process_manager_choices"): metafunc.module.process_manager_choices = { "StandAloneSSH_PM" : {"pm_type": "ssh-standalone"} } @@ -80,6 +80,7 @@ def pytest_generate_tests(metafunc): parametrize_fixture_with_items(metafunc, "run_nanorc", "nanorc_command_list") +# 29-Dec-2025, KAB: added fixture to handle different process manager choices @pytest.fixture(scope="module") def process_manager_type(request, tmp_path_factory): result = ProcessManagerChoice ( @@ -448,7 +449,7 @@ class RunResult: result.completed_process = subprocess.run( [nanorc] + nanorc_option_strings - + [str(process_manager_type.pm_type)] + + [str(process_manager_type.pm_type)] # 29-Dec-2025, KAB: support for ProcMgr choices + [str(create_config_files.config_file)] + [str(create_config_files.config.session)] + [str(create_config_files.config.session_name if create_config_files.config.session_name else create_config_files.config.session)]