diff --git a/.github/workflows/dunedaq-develop-cpp-ci.yml b/.github/workflows/dunedaq-develop-cpp-ci.yml index 067fb7f0..1c82e096 100644 --- a/.github/workflows/dunedaq-develop-cpp-ci.yml +++ b/.github/workflows/dunedaq-develop-cpp-ci.yml @@ -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 }} \ No newline at end of file + caller_event_name: ${{ github.event.inputs.caller_event_name || github.event_name }} diff --git a/integtest/disabled_output_test.py b/integtest/disabled_output_test.py index 59749d87..10a792fe 100644 --- a/integtest/disabled_output_test.py +++ b/integtest/disabled_output_test.py @@ -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" @@ -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 @@ -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 @@ -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 ) @@ -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( diff --git a/integtest/hdf5_compression_test.py b/integtest/hdf5_compression_test.py index 4e8c9fa9..2373bdba 100644 --- a/integtest/hdf5_compression_test.py +++ b/integtest/hdf5_compression_test.py @@ -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 @@ -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 @@ -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( @@ -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)): @@ -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( @@ -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: @@ -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("============================================") diff --git a/integtest/insufficient_disk_space_test.py b/integtest/insufficient_disk_space_test.py index f3e76215..0f13d955 100644 --- a/integtest/insufficient_disk_space_test.py +++ b/integtest/insufficient_disk_space_test.py @@ -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" - -# 02-Jun-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" # 21-Jul-2022, KAB: # --> problems in the C++ code that this script currently highlights @@ -67,16 +69,14 @@ } # Determine if the conditions are right for these tests -resval = resource_validation.ResourceValidator() -resval.require_cpu_count(45) # total number of data sources plus 50% more for everything else -resval.require_free_memory_gb(35) # the maximum amount that we observe being used ('free -h') -resval.require_total_memory_gb(70) # double what we need; trying to be kind to others -actual_output_path = output_path_parameter -if output_path_parameter == ".": - actual_output_path = "/tmp" -resval.require_free_disk_space_gb(actual_output_path, minimum_free_disk_space_gb) -resval_debug_string = resval.get_debug_string() -print(f"{resval_debug_string}") +resource_validator = resource_validation.ResourceValidator() +resource_validator.cpu_count_needs(12, 24) # 1/3 for each data source (30) plus two more for everything else +resource_validator.free_memory_needs(50, 70) # 10% 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, minimum_free_disk_space_gb) +resource_validator.total_disk_space_needs(actual_output_path, + recommended_total_disk_space=2*minimum_free_disk_space_gb) # double what we need # We simulate a nearly-full output disk by setting the free-space-safety-factor # that the data writer uses to a custom value, based on the free space on disk. @@ -85,7 +85,7 @@ # the disk is full when there is still ~< 10 GB of free space. And, having a # 1 GB size for the TRs means that we will write approximately # desired_free_disk_space_gb TriggerRecords before appearing to run out of space. -free_space_safety_factor = int(resval.free_disk_space_gb - desired_size_of_output_disk_gb) +free_space_safety_factor = round(resource_validator.free_disk_space_gb - desired_size_of_output_disk_gb) # 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 @@ -139,52 +139,29 @@ "Base_System": conf_dict, } # 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 ".split() - + [str(run_duration)] - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + "start --run-number 102 wait 1 enable-triggers wait ".split() - + [str(run_duration)] - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + "start --run-number 103 wait 1 enable-triggers wait ".split() - + [str(run_duration)] - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + " scrap terminate".split() - ) -else: - dunerc_command_list = ["wait", "1"] +dunerc_command_list = ( + "boot conf wait 5".split() + + "start --run-number 101 wait 1 enable-triggers wait ".split() + + [str(run_duration)] + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + "start --run-number 102 wait 1 enable-triggers wait ".split() + + [str(run_duration)] + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + "start --run-number 103 wait 1 enable-triggers wait ".split() + + [str(run_duration)] + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + " scrap terminate".split() +) # 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( @@ -193,14 +170,11 @@ def test_log_files(run_dunerc): True, ignored_logfile_problems, required_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}") - local_expected_event_count = expected_event_count local_event_count_tolerance = expected_event_count_tolerance fragment_check_list = [triggercandidate_frag_params] @@ -210,14 +184,15 @@ def test_data_files(run_dunerc): # Run some tests on the output data file all_ok = len(run_dunerc.data_files) == expected_number_of_data_files or len(run_dunerc.data_files) == (expected_number_of_data_files+1) - print("") # Clear potential dot from pytest + #print("") # Clear potential dot from pytest if all_ok: - print(f"\N{WHITE HEAVY CHECK MARK} An acceptable number of raw data files was found ({len(run_dunerc.data_files)} in {expected_number_of_data_files}..{expected_number_of_data_files+1})") + if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions): + print(f"\N{WHITE HEAVY CHECK MARK} An acceptable number of raw data files was found ({len(run_dunerc.data_files)} in {expected_number_of_data_files}..{expected_number_of_data_files+1})") else: print(f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of raw data files was found, expected {expected_number_of_data_files}..{expected_number_of_data_files+1}, 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) all_ok &= data_file_checks.check_event_count( @@ -234,10 +209,6 @@ def test_data_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: @@ -246,17 +217,19 @@ 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() - 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("============================================") diff --git a/integtest/large_trigger_record_test.py b/integtest/large_trigger_record_test.py index 8b75e0a8..8f9519f3 100644 --- a/integtest/large_trigger_record_test.py +++ b/integtest/large_trigger_record_test.py @@ -12,14 +12,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" - -# 02-Jun-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 output_path_parameter = "." @@ -68,22 +70,16 @@ } # Determine if the conditions are right for these tests -resval = resource_validation.ResourceValidator() -resval.require_cpu_count(45) # total number of data sources plus 50% more for everything else -resval.require_free_memory_gb(28) # the maximum amount that we observe being used ('free -h') -resval.require_total_memory_gb(56) # double what we need; trying to be kind to others -actual_output_path = output_path_parameter -if output_path_parameter == ".": - actual_output_path = "/tmp" +resource_validator = resource_validation.ResourceValidator() +resource_validator.cpu_count_needs(12, 24) # 1/3 for each data source (30) plus two more for everything else +resource_validator.free_memory_needs(28, 40) # 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() # The largest data set in this test is four 2.55 GB files. To handle these four files # plus a safety factor of three for the last one, we need 6*2.55 = 15.3. # Note that a safety factor of 3 is configured below, over-riding the default value of 5. -resval.require_free_disk_space_gb(actual_output_path, 16) -# The value of 19 GB for the total disk space is just to reserve some space beyond what this -# test needs for others to use, and to be slightly lower than a typical 20 GB full disk size. -resval.require_total_disk_space_gb(actual_output_path, 19) -resval_debug_string = resval.get_debug_string() -print(f"{resval_debug_string}") +resource_validator.free_disk_space_needs(actual_output_path, 16, 20) +resource_validator.total_disk_space_needs(actual_output_path, recommended_total_disk_space=24) # 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 @@ -159,61 +155,35 @@ "TRSize_125PercentOfMaxFileSize": oversize_conf, } # 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 10 enable-triggers wait ".split() - + [str(run_duration)] - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + "start --run-number 102 wait 10 enable-triggers wait ".split() - + [str(run_duration)] - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + " scrap terminate".split() - ) -else: - dunerc_command_list = ["wait", "1"] +dunerc_command_list = ( + "boot conf wait 5".split() + + "start --run-number 101 wait 10 enable-triggers wait ".split() + + [str(run_duration)] + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + "start --run-number 102 wait 10 enable-triggers wait ".split() + + [str(run_duration)] + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + " scrap terminate".split() +) # 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=True) 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}") - local_expected_event_count = expected_event_count local_event_count_tolerance = expected_event_count_tolerance fragment_check_list = [triggercandidate_frag_params] @@ -230,14 +200,15 @@ def test_data_files(run_dunerc): # Run some tests on the output data file all_ok = len(run_dunerc.data_files) == expected_number_of_data_files - print("") # Clear potential dot from pytest + #print("") # Clear potential dot from pytest if all_ok: - print(f"\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found ({expected_number_of_data_files})") + if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions): + print(f"\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found ({expected_number_of_data_files})") else: print(f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of raw data files was found, expected {expected_number_of_data_files}, 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) all_ok &= data_file_checks.check_event_count( @@ -255,10 +226,6 @@ def test_data_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: @@ -267,17 +234,19 @@ 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() - 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("============================================") diff --git a/integtest/max_file_size_test.py b/integtest/max_file_size_test.py index 34b36119..22ed4c91 100644 --- a/integtest/max_file_size_test.py +++ b/integtest/max_file_size_test.py @@ -5,15 +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" - -# 02-Jun-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 @@ -96,8 +97,6 @@ actual_output_path = get_pytest_tmpdir() resource_validator.free_disk_space_needs(actual_output_path, 6, 10) # 20% more than what we need resource_validator.total_disk_space_needs(actual_output_path, recommended_total_disk_space=15) # double what we need -resval_debug_string = resource_validator.get_debug_string() -print(f"{resval_debug_string}") # 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 @@ -213,26 +212,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=False) 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 ) @@ -243,14 +233,15 @@ def test_data_files(run_dunerc): # 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)): @@ -268,14 +259,15 @@ def test_tpstream_files(run_dunerc): fragment_check_list = [wibeth_tpset_params] # WIBEth 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( @@ -297,19 +289,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("============================================") diff --git a/integtest/multiple_data_writers_test.py b/integtest/multiple_data_writers_test.py index cad0d282..200cdef1 100644 --- a/integtest/multiple_data_writers_test.py +++ b/integtest/multiple_data_writers_test.py @@ -5,8 +5,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" @@ -64,15 +70,13 @@ ], } -# Determine if the conditions are right for this testing -resval = resource_validation.ResourceValidator() -resval.require_cpu_count(10) # one per data source, plus several spares -resval.require_free_memory_gb(10) # approximately what we observe -resval.require_total_memory_gb(20) # safety factor of 2 -actual_output_path = "/tmp" -resval.require_free_disk_space_gb(actual_output_path, 1) # what we observe -resval_debug_string = resval.get_debug_string() -print(f"{resval_debug_string}") +# Determine if the conditions are right for these tests +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(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 @@ -129,72 +133,47 @@ } # 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 30".split() - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + "start --run-number 102 wait 1 enable-triggers wait 30".split() - + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() - + " scrap terminate".split() - ) -else: - dunerc_command_list = ["wait", "1"] +dunerc_command_list = ( + "boot conf wait 5".split() + + "start --run-number 101 wait 1 enable-triggers wait 30".split() + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + "start --run-number 102 wait 1 enable-triggers wait 30".split() + + "disable-triggers wait 2 drain-dataflow wait 2 stop-trigger-sources stop ".split() + + " scrap terminate".split() +) # 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, wibeth_frag_params] fragment_check_list.append(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)): diff --git a/integtest/offline_prod_run_test.py b/integtest/offline_prod_run_test.py index 699117ea..344058f0 100644 --- a/integtest/offline_prod_run_test.py +++ b/integtest/offline_prod_run_test.py @@ -5,7 +5,12 @@ 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 +from integrationtest.verbosity_helper import IntegtestVerbosityLevels + +import functools +print = functools.partial(print, flush=True) # always flush print() output pytest_plugins = "integrationtest.integrationtest_drunc" @@ -79,7 +84,7 @@ ) ) -confgen_arguments = {"SmallFootprint": conf_dict} +confgen_arguments = {"OfflineProdRun": conf_dict} # The commands to run in dunerc, as a list dunerc_command_list = ( "boot conf start --run-number 101 --run-type PROD wait 1 enable-triggers wait ".split() @@ -90,26 +95,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=False) 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 ) @@ -122,7 +118,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, was_test_run="false") all_ok &= data_file_checks.check_event_count( diff --git a/integtest/trmonrequestor_test.py b/integtest/trmonrequestor_test.py index 23ded65b..f88096f9 100755 --- a/integtest/trmonrequestor_test.py +++ b/integtest/trmonrequestor_test.py @@ -5,7 +5,12 @@ 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 +from integrationtest.verbosity_helper import IntegtestVerbosityLevels + +import functools +print = functools.partial(print, flush=True) # always flush print() output pytest_plugins = "integrationtest.integrationtest_drunc" @@ -102,19 +107,9 @@ def make_run_command_list(runnum): dunerc_command_list += " scrap terminate".split() # 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=False) def test_log_files(run_dunerc): @@ -137,18 +132,20 @@ 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 ) def test_data_files(run_dunerc): # Run some tests on the output data file all_ok = len(run_dunerc.data_files) == expected_number_of_data_files - print("") # Clear potential dot from pytest + #print("") # Clear potential dot from pytest if all_ok: - print( - f"\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found ({expected_number_of_data_files})" - ) + if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions): + print( + f"\N{WHITE HEAVY CHECK MARK} The correct number of raw data files was found ({expected_number_of_data_files})" + ) else: print( f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of raw data files was found, expected {expected_number_of_data_files}, found {len(run_dunerc.data_files)} \N{POLICE CARS REVOLVING LIGHT}" @@ -159,7 +156,7 @@ def test_data_files(run_dunerc): nontrig_fragment_check_list = [hsi_frag_params, wibeth_frag_params] 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( @@ -184,16 +181,17 @@ def test_data_files(run_dunerc): print("") # Add break from Data file printouts if trmon_ok: - print( - f"\N{WHITE HEAVY CHECK MARK} The correct number of TRMon data files was found ({trmon_high} > {len(run_dunerc.trmon_files)} > {trmon_low})" - ) + if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.drunc_transitions): + print( + f"\N{WHITE HEAVY CHECK MARK} The correct number of TRMon data files was found ({trmon_high} > {len(run_dunerc.trmon_files)} > {trmon_low})" + ) else: print( f"\N{POLICE CARS REVOLVING LIGHT} An incorrect number of TRMon data files was found, expected between {trmon_low} and {trmon_high}, found {len(run_dunerc.trmon_files)} \N{POLICE CARS REVOLVING LIGHT}" ) for idx in range(len(run_dunerc.trmon_files)): - data_file = data_file_checks.DataFile(run_dunerc.trmon_files[idx]) + data_file = data_file_checks.DataFile(run_dunerc.trmon_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(data_file, 1, 0)