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
2 changes: 2 additions & 0 deletions python/integrationtest/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class drunc_config:
dro_map_config: DROMap_config = field(default_factory=lambda: DROMap_config(1))
frame_file: str = "asset://?checksum=e96fd6efd3f98a9a3bfaba32975b476e"
tpg_enabled: bool = False
trmon_app_enabled: bool = False
fake_hsi_enabled: bool = False
use_fakedataprod: bool = False
config_db: str = ""
Expand All @@ -67,3 +68,4 @@ class CreateConfigResult:
log_file: str
data_dirs: list[str]
tpstream_data_dirs: list[str]
trmon_data_dirs: list[str]
38 changes: 38 additions & 0 deletions python/integrationtest/integrationtest_drunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def create_config_files(request, tmp_path_factory):
tpwriting_enabled=drunc_config.tpg_enabled,
generate_segment=True,
n_data_writers=drunc_config.n_data_writers,
trmon_app=drunc_config.trmon_app_enabled,
)

generate_session(
Expand Down Expand Up @@ -236,6 +237,7 @@ def apply_update(obj, substitution):
# 30-Dec-2024, KAB: build up the list of directories used for writing raw and TPStream data
rawdata_dirs = []
tpstream_dirs = []
trmon_dirs = []
segment = sessionobj.segment
app_list = get_segment_apps(segment)
for app in app_list:
Expand All @@ -256,6 +258,14 @@ def apply_update(obj, substitution):
except:
# not a TPStreamWriterApplication, so simply continue to the next app
pass
try:
trmonapp = db.get_dal(class_name="TRMonReqApplication", uid=app)
outdir = trmonapp.data_store_params.directory_path
if outdir not in trmon_dirs:
trmon_dirs.append(outdir)
except:
# not a TPStreamWriterApplication, so simply continue to the next app
pass

result = CreateConfigResult(
config=drunc_config,
Expand All @@ -264,6 +274,7 @@ def apply_update(obj, substitution):
log_file=logfile,
data_dirs=rawdata_dirs,
tpstream_data_dirs=tpstream_dirs,
trmon_data_dirs=trmon_dirs
)

yield result
Expand Down Expand Up @@ -339,6 +350,8 @@ class RunResult:
rawdata_paths = create_config_files.data_dirs
tpset_dirs = [run_dir]
tpset_paths = create_config_files.tpstream_data_dirs
trmon_dirs = [run_dir]
trmon_paths = create_config_files.trmon_data_dirs

for path in rawdata_paths:
rawdata_dir = pathlib.Path(path)
Expand Down Expand Up @@ -380,6 +393,26 @@ class RunResult:
if (now - modified_time) > 3600:
print(f"Deleting TP data file from earlier test: {str(file_obj)}")
file_obj.unlink(True) # missing is OK
for trmon_path in trmon_paths:
trmon_dir = pathlib.Path(trmon_path)
if trmon_dir not in trmon_dirs:
trmon_dirs.append(trmon_dir)
# deal with any pre-existing data files
temp_suffix = ".temp_saved"
now = time.time()
for file_obj in trmon_dir.glob(
f"{create_config_files.config.op_env}_trmon*.hdf5"
):
print(f"Renaming TRMon data file from earlier test: {str(file_obj)}")
new_name = str(file_obj) + temp_suffix
file_obj.rename(new_name)
for file_obj in trmon_dir.glob(
f"{create_config_files.config.op_env}_trmon*.hdf5{temp_suffix}"
):
modified_time = file_obj.stat().st_mtime
if (now - modified_time) > 3600:
print(f"Deleting TRMon data file from earlier test: {str(file_obj)}")
file_obj.unlink(True) # missing is OK

print(
"++++++++++ DRUNC Run BEGIN ++++++++++", flush=True
Expand Down Expand Up @@ -427,6 +460,11 @@ class RunResult:
result.tpset_files += list(
tpset_dir.glob(f"{create_config_files.config.op_env}_tp_*.hdf5")
)
result.trmon_files = []
for trmon_dir in trmon_dirs:
result.trmon_files += list(
trmon_dir.glob(f"{create_config_files.config.op_env}_trmon_*.hdf5")
)
result.log_files = list(run_dir.glob("log_*.txt")) + list(run_dir.glob("log_*.log"))
result.opmon_files = list(run_dir.glob("info_*.json"))
print("---------- DRUNC Run END ----------", flush=True)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = integrationtest
version = 3.4.0
version = 3.5.0
url = https://github.com/DUNE-DAQ/integrationtest
long_description = file: docs/README.md
long_description_content_type = text/markdown
Expand Down