Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion integtest/3ru_3df_multirun_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,33 @@
],
}

# Introduction: the basic pattern used in the DUNE DAQ integration tests is to set up and
# run one or more instances of the DAQ system ("DAQ sessions") and then verify that the
# results of each test run (which often use emulated data sources) match what is expected,
# given the configuration(s) of the DAQ system that the test writer provided.
#
# In all of this, the word "test" is a bit over-loaded.
# * The pytest framework refers to the functions that are run to check the results of the
# data-taking as "tests". We tend to call those "validations" or "checks". When we
# see the summary at the end of an integtest report that 'N tests were run', that
# means N validation functions were run by the pytest framework to check the results
# of the data taking in various ways.
# * Distinct from that, we tend to use the word "test" to refer to one of our integtests.
# That is, the set of DAQ sessions and validation checks that are in one of these *_test.py
# files.
#
# In each of these integtest files, there are two categories of information that are required
# to be provided to our integtest infrastructure and one optional type. These are used to
# set up and loop through the desired DAQ sessions. The categories are the following:
# 1. the configuration of the DAQ system (system topology, application parameters, etc.)
# 2. the list of process managers that should be used [optional]
# 3. the list of run control commands that should be executed
# More information is provided about each of these below [coming soon!].
#

# 29-Dec-2025, KAB: The following comment about three variables is out-of-date.
# It will be replaced soon, and the comment block above is a start on that.
#
# The next three variable declarations *must* be present as globals in the test
# file. They're read by the "fixtures" in conftest.py to determine how
# to run the config generation and nanorc
Expand Down Expand Up @@ -138,6 +165,13 @@
"WIBEth_System": conf_dict,
"Software_TPG_System": swtpg_conf,
}

# 29-Dec-2025, KAB: added sample process manager choices.
process_manager_choices = {
"StandAloneSSH_PM" : {"pm_type": "ssh-standalone"},
# "ParamikoClient_PM" : {"pm_type": "ssh-standalone-paramiko-client"},
}

# The commands to run in nanorc, as a list
nanorc_command_list = "boot conf".split()
nanorc_command_list += (
Expand All @@ -162,7 +196,7 @@

def test_nanorc_success(run_nanorc):
current_test = os.environ.get("PYTEST_CURRENT_TEST")
match_obj = re.search(r".*\[(.+)\].*", current_test)
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
if match_obj:
current_test = match_obj.group(1)
banner_line = re.sub(".", "=", current_test)
Expand Down
17 changes: 9 additions & 8 deletions integtest/tpreplay_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,20 +296,21 @@ def test_data_files(run_nanorc):
}

# Match run to checks
match = re.search(r'\[(.+?)-run', current_test)
if match:
key = match.group(1)
if key in datafile_params:
# 29-Dec-2025, KAB: modified this block of code to work with the addition of
# the process-manager-choice fixture.
selected_params = {}
for key in datafile_params.keys():
if key in current_test:
selected_params = datafile_params[key]
print("Selected params for", key, ":", selected_params)
else:
print(f"Key '{key}' not found in datafile_params.")
else:
print("Could not extract key from current_test.")
break
if not selected_params:
print(f"\n*** ERROR: unable to determine the datafile_params for test {current_test}.")

### Run some tests on the output data file
all_ok = True

all_ok &= len(run_nanorc.data_files) == selected_params["n_data_files"]
if all_ok:
print(f"\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found ({selected_params['n_data_files']})")
else:
Expand Down
16 changes: 8 additions & 8 deletions integtest/trigger_bitwords_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,16 +302,16 @@ def test_data_files(run_nanorc):
}

# Match run to checks
match = re.search(r'\[(.+?)-run', current_test)
if match:
key = match.group(1)
if key in datafile_params:
# 29-Dec-2025, KAB: modified this block of code to work with the addition of
# the process-manager-choice fixture.
selected_params = {}
for key in datafile_params.keys():
if key in current_test:
selected_params = datafile_params[key]
print("Selected params for", key, ":", selected_params)
else:
print(f"Key '{key}' not found in datafile_params.")
else:
print("Could not extract key from current_test.")
break
if not selected_params:
print(f"\n*** ERROR: unable to determine the datafile_params for test {current_test}.")

### Run some tests on the output data file
all_ok = True
Expand Down
Loading