Skip to content
Open
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: 1 addition & 1 deletion .github/workflows/dunedaq-develop-cpp-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
name: Build against the development release
uses: DUNE-DAQ/.github/.github/workflows/dunedaq-develop-cpp-ci.yml@develop
with:
caller_event_name: ${{ github.event.inputs.caller_event_name || github.event_name }}
caller_event_name: ${{ github.event.inputs.caller_event_name || github.event_name }}
46 changes: 26 additions & 20 deletions integtest/disabled_output_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@

import integrationtest.data_file_checks as data_file_checks
import integrationtest.log_file_checks as log_file_checks
import integrationtest.basic_checks as basic_checks
import integrationtest.data_classes as data_classes
import integrationtest.resource_validation as resource_validation
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
from integrationtest.verbosity_helper import IntegtestVerbosityLevels

import functools
print = functools.partial(print, flush=True) # always flush print() output

pytest_plugins = "integrationtest.integrationtest_drunc"

Expand Down Expand Up @@ -78,6 +85,14 @@
],
}

# Determine if the conditions are right for these tests
resource_validator = resource_validation.ResourceValidator()
resource_validator.cpu_count_needs(6, 12) # two for each data source plus two more for everything else
resource_validator.free_memory_needs(10, 20) # 25% more than what we observe being used ('free -h')
resource_validator.total_memory_needs() # no specific request, but it's useful to see how much is available
actual_output_path = get_pytest_tmpdir()
resource_validator.free_disk_space_needs(actual_output_path, 1) # what we observe

# 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 dunerc
Expand Down Expand Up @@ -113,22 +128,22 @@
)
)

swtpg_conf = copy.deepcopy(conf_dict)
swtpg_conf.tpg_enabled = True
swtpg_conf.config_substitutions.append(
tpg_conf = copy.deepcopy(conf_dict)
tpg_conf.tpg_enabled = True
tpg_conf.config_substitutions.append(
data_classes.attribute_substitution(
obj_class="TAMakerPrescaleAlgorithm",
obj_id="dummy-ta-maker",
updates={"prescale": 25},
)
)
swtpg_conf.frame_file = (
tpg_conf.frame_file = (
"asset://?checksum=dd156b4895f1b06a06b6ff38e37bd798" # WIBEth All Zeros
)

confgen_arguments = {
"WIBEth_System": conf_dict,
"Software_TPG_System": swtpg_conf,
"WIBEth_TPG_System": tpg_conf,
}

# The commands to run in dunerc, as a list
Expand Down Expand Up @@ -158,26 +173,17 @@
# The tests themselves


def test_dunerc_success(run_dunerc):
# print the name of the current test
current_test = os.environ.get("PYTEST_CURRENT_TEST")
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
if match_obj:
current_test = match_obj.group(1)
banner_line = re.sub(".", "=", current_test)
print(banner_line)
print(current_test)
print(banner_line)

# Check that dunerc completed correctly
assert run_dunerc.completed_process.returncode == 0
def test_dunerc_success(run_dunerc, caplog):
# checks for run control success, problems during pytest setup, etc.
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)


def test_log_files(run_dunerc):
if check_for_logfile_errors:
# Check that there are no warnings or errors in the log files
assert log_file_checks.logs_are_error_free(
run_dunerc.log_files, True, True, ignored_logfile_problems
run_dunerc.log_files, True, True, ignored_logfile_problems,
verbosity_helper=run_dunerc.verbosity_helper
)


Expand All @@ -204,7 +210,7 @@ def test_data_files(run_dunerc):

all_ok = True
for idx in range(len(run_dunerc.data_files)):
data_file = data_file_checks.DataFile(run_dunerc.data_files[idx])
data_file = data_file_checks.DataFile(run_dunerc.data_files[idx], run_dunerc.verbosity_helper)
all_ok &= data_file_checks.sanity_check(data_file)
all_ok &= data_file_checks.check_file_attributes(data_file)
all_ok &= data_file_checks.check_event_count(
Expand Down
120 changes: 45 additions & 75 deletions integtest/hdf5_compression_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@

import integrationtest.data_file_checks as data_file_checks
import integrationtest.log_file_checks as log_file_checks
import integrationtest.basic_checks as basic_checks
import integrationtest.data_classes as data_classes
import integrationtest.resource_validation as resource_validation
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
from integrationtest.verbosity_helper import IntegtestVerbosityLevels

pytest_plugins = "integrationtest.integrationtest_drunc"

# 20-May-2025, KAB: tweak the print() statement default behavior so that it always flushes the output.
import functools
print = functools.partial(print, flush=True)
print = functools.partial(print, flush=True) # always flush print() output

pytest_plugins = "integrationtest.integrationtest_drunc"

# Values that help determine the running conditions
number_of_data_producers = 2
Expand Down Expand Up @@ -106,15 +108,13 @@
}

# Determine if the conditions are right for these tests
resval = resource_validation.ResourceValidator()
resval.require_cpu_count(15) # total number of data sources (6RU+3TP) plus several more for everything else
resval.require_free_memory_gb(10) # the maximum amount that we observe being used ('free -h')
resval.require_total_memory_gb(20) # double what we need; trying to be kind to others
actual_output_path = "/tmp"
resval.require_free_disk_space_gb(actual_output_path, 5) # what we actually use (3) plus margin
resval.require_total_disk_space_gb(actual_output_path, 10) # factor of two to reserve some for others
resval_debug_string = resval.get_debug_string()
print(f"{resval_debug_string}")
resource_validator = resource_validation.ResourceValidator()
resource_validator.cpu_count_needs(9, 18) # total number of data sources (6) plus three more for everything else
resource_validator.free_memory_needs(12, 25) # 20% more than what we observe being used ('free -h')
resource_validator.total_memory_needs() # no specific request, but it's useful to see how much is available
actual_output_path = get_pytest_tmpdir()
resource_validator.free_disk_space_needs(actual_output_path, 5) # what we actually use (3) plus margin
resource_validator.total_disk_space_needs(actual_output_path, recommended_total_disk_space=10) # double what we need

# 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
Expand All @@ -130,7 +130,7 @@
conf_dict.tpg_enabled = True
conf_dict.fake_hsi_enabled = True
conf_dict.dro_map_config.det_id = 2 # det_id = 2 for kHD_PDS
conf_dict.frame_file = "asset://?checksum=a8990a9eb3a505d4ded62dfdfa9e2681" # run 36012
conf_dict.frame_file = "asset://?checksum=a8990a9eb3a505d4ded62dfdfa9e2681" # run 36012 DAPHNE data
#conf_dict.frame_file = "file:///home/nfs/biery/dunedaq/12MayFDv5.3.2DevInstrUpdate/sourcecode/dfmodules/integtest/np02vdcoldbox_run035227_sample_hd_pds.bin"

conf_dict.config_substitutions.append(
Expand Down Expand Up @@ -231,73 +231,48 @@
}

# The commands to run in dunerc, as a list
if resval.this_computer_has_sufficient_resources:
dunerc_command_list = (
"boot conf wait 5".split()
+ "start --run-number 101 wait 1 enable-triggers wait 100".split()
+ "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split()
+ "start --run-number 102 wait 1 enable-triggers wait 100".split()
+ "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split()
+ " scrap terminate".split()
dunerc_command_list = (
"boot conf wait 5".split()
+ "start --run-number 101 wait 1 enable-triggers wait 100".split()
+ "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split()
+ "start --run-number 102 wait 1 enable-triggers wait 100".split()
+ "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split()
+ " scrap terminate".split()
)
else:
dunerc_command_list = ["wait", "1"]

# The tests themselves


def test_dunerc_success(run_dunerc):
if not resval.this_computer_has_sufficient_resources:
resval_report_string = resval.get_insufficient_resources_report()
print(f"{resval_report_string}")
resval_summary_string = resval.get_insufficient_resources_summary()
pytest.skip(f"{resval_summary_string}")

# print the name of the current test
current_test = os.environ.get("PYTEST_CURRENT_TEST")
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
if match_obj:
current_test = match_obj.group(1)
banner_line = re.sub(".", "=", current_test)
print(banner_line)
print(current_test)
print(banner_line)

# Check that dunerc completed correctly
assert run_dunerc.completed_process.returncode == 0
def test_dunerc_success(run_dunerc, caplog):
# checks for run control success, problems during pytest setup, etc.
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False)


def test_log_files(run_dunerc):
if not resval.this_computer_has_sufficient_resources:
resval_summary_string = resval.get_insufficient_resources_summary()
pytest.skip(f"{resval_summary_string}")

if check_for_logfile_errors:
# Check that there are no warnings or errors in the log files
assert log_file_checks.logs_are_error_free(
run_dunerc.log_files, True, True, ignored_logfile_problems
run_dunerc.log_files, True, True, ignored_logfile_problems,
verbosity_helper=run_dunerc.verbosity_helper
)


def test_data_files(run_dunerc):
if not resval.this_computer_has_sufficient_resources:
resval_summary_string = resval.get_insufficient_resources_summary()
pytest.skip(f"{resval_summary_string}")

fragment_check_list = [triggercandidate_frag_params, hsi_frag_params, daphne_frag_params]
fragment_check_list.append(daphne_triggerprimitive_frag_params)
fragment_check_list.append(triggeractivity_frag_params)

# Run some tests on the output data file
all_ok = len(run_dunerc.data_files) == 6 # three for each run
print("") # Clear potential dot from pytest
#print("") # Clear potential dot from pytest
if all_ok:
print("\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found (6)")
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions):
print("\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found (6)")
else:
print(f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of raw data files was found, expected 6, found {len(run_dunerc.data_files)} \N{POLICE CARS REVOLVING LIGHT}")

for idx in range(len(run_dunerc.data_files)):
data_file = data_file_checks.DataFile(run_dunerc.data_files[idx])
data_file = data_file_checks.DataFile(run_dunerc.data_files[idx], run_dunerc.verbosity_helper)
all_ok &= data_file_checks.sanity_check(data_file)
all_ok &= data_file_checks.check_file_attributes(data_file)
for jdx in range(len(fragment_check_list)):
Expand All @@ -311,22 +286,19 @@ def test_data_files(run_dunerc):


def test_tpstream_files(run_dunerc):
if not resval.this_computer_has_sufficient_resources:
resval_summary_string = resval.get_insufficient_resources_summary()
pytest.skip(f"{resval_summary_string}")

tpstream_files = run_dunerc.tpset_files
fragment_check_list = [daphne_tpset_params]

all_ok = len(tpstream_files) == 6 # three for each run
print("") # Clear potential dot from pytest
#print("") # Clear potential dot from pytest
if all_ok:
print("\N{WHITE HEAVY CHECK MARK} The correct number of TP-stream data files was found (6)")
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions):
print("\N{WHITE HEAVY CHECK MARK} The correct number of TP-stream data files was found (6)")
else:
print(f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of TP-stream data files was found, expected 6, found {len(tpstream_files)} \N{POLICE CARS REVOLVING LIGHT}")

for idx in range(len(tpstream_files)):
data_file = data_file_checks.DataFile(tpstream_files[idx])
data_file = data_file_checks.DataFile(tpstream_files[idx], run_dunerc.verbosity_helper)
all_ok &= data_file_checks.check_file_attributes(data_file)
for jdx in range(len(fragment_check_list)):
all_ok &= data_file_checks.check_fragment_count(
Expand All @@ -336,10 +308,6 @@ def test_tpstream_files(run_dunerc):


def test_cleanup(run_dunerc):
if not resval.this_computer_has_sufficient_resources:
resval_summary_string = resval.get_insufficient_resources_summary()
pytest.skip(f"{resval_summary_string}")

pathlist_string = ""
filelist_string = ""
for data_file in run_dunerc.data_files:
Expand All @@ -352,19 +320,21 @@ def test_cleanup(run_dunerc):
pathlist_string += " " + str(data_file.parent)

if pathlist_string and filelist_string:
print("============================================")
print("Listing the hdf5 files before deleting them:")
print("============================================")
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.integtest_debug):
print("============================================")
print("Listing the hdf5 files before deleting them:")
print("============================================")

os.system(f"df -h {pathlist_string}")
print("--------------------")
os.system(f"ls -alF {filelist_string}")
os.system(f"df -h {pathlist_string}")
print("--------------------")
os.system(f"ls -alF {filelist_string}")

for data_file in run_dunerc.data_files:
data_file.unlink()
for data_file in run_dunerc.tpset_files:
data_file.unlink()

print("--------------------")
os.system(f"df -h {pathlist_string}")
print("============================================")
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.integtest_debug):
print("--------------------")
os.system(f"df -h {pathlist_string}")
print("============================================")
Loading