Skip to content

Commit 7a1edf6

Browse files
authored
Merge pull request #320 from DUNE-DAQ/kbiery/remove_integtest_hdf5_files
Modified the integtests to support user-requested deletion of HDF5 files at the end of each integtest.
2 parents 1238477 + 1e4e4ca commit 7a1edf6

14 files changed

Lines changed: 29 additions & 57 deletions

integtest/3ru_1df_multirun_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import integrationtest.data_file_checks as data_file_checks
77
import integrationtest.log_file_checks as log_file_checks
8-
import integrationtest.basic_checks as basic_checks
98
import integrationtest.data_classes as data_classes
109
import integrationtest.resource_validation as resource_validation
10+
import integrationtest.utility_functions as utility_functions
1111
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1212
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1313

@@ -169,7 +169,7 @@
169169

170170
def test_dunerc_success(run_dunerc, caplog):
171171
# checks for run control success, problems during pytest setup, etc.
172-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
172+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
173173

174174

175175
def test_log_files(run_dunerc):

integtest/3ru_3df_multirun_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
import integrationtest.data_file_checks as data_file_checks
66
import integrationtest.log_file_checks as log_file_checks
7-
import integrationtest.basic_checks as basic_checks
87
import integrationtest.data_classes as data_classes
98
import integrationtest.resource_validation as resource_validation
9+
import integrationtest.utility_functions as utility_functions
1010
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1111
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1212

@@ -192,7 +192,7 @@
192192

193193
def test_dunerc_success(run_dunerc, caplog):
194194
# checks for run control success, problems during pytest setup, etc.
195-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
195+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
196196

197197

198198
def test_log_files(run_dunerc):

integtest/disabled_tpg_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
import integrationtest.data_file_checks as data_file_checks
1616
import integrationtest.log_file_checks as log_file_checks
17-
import integrationtest.basic_checks as basic_checks
1817
import integrationtest.data_classes as data_classes
1918
import integrationtest.resource_validation as resource_validation
19+
import integrationtest.utility_functions as utility_functions
2020
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
2121
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
2222

@@ -132,7 +132,7 @@
132132

133133
def test_dunerc_success(run_dunerc, caplog):
134134
# check for run control success, problems during pytest setup, etc.
135-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
135+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
136136

137137

138138
def test_log_files(run_dunerc):

integtest/example_system_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import integrationtest.data_file_checks as data_file_checks
1010
import integrationtest.log_file_checks as log_file_checks
11-
import integrationtest.basic_checks as basic_checks
1211
import integrationtest.data_classes as data_classes
1312
import integrationtest.resource_validation as resource_validation
13+
import integrationtest.utility_functions as utility_functions
1414
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1515
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1616

@@ -153,7 +153,7 @@ def host_is_at_ehn1(hostname):
153153

154154
def test_dunerc_success(run_dunerc, caplog):
155155
# checks for run control success, problems during pytest setup, etc.
156-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
156+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
157157

158158

159159
def test_log_files(run_dunerc):

integtest/fake_data_producer_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import integrationtest.data_file_checks as data_file_checks
88
import integrationtest.log_file_checks as log_file_checks
9-
import integrationtest.basic_checks as basic_checks
109
import integrationtest.data_classes as data_classes
1110
import integrationtest.resource_validation as resource_validation
11+
import integrationtest.utility_functions as utility_functions
1212
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1313
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1414

@@ -122,7 +122,7 @@
122122

123123
def test_dunerc_success(run_dunerc, caplog):
124124
# checks for run control success, problems during pytest setup, etc.
125-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
125+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
126126

127127

128128
def test_log_files(run_dunerc):

integtest/long_window_readout_test.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
import integrationtest.data_file_checks as data_file_checks
2020
import integrationtest.log_file_checks as log_file_checks
21-
import integrationtest.basic_checks as basic_checks
2221
import integrationtest.data_classes as data_classes
2322
import integrationtest.resource_validation as resource_validation
23+
import integrationtest.utility_functions as utility_functions
2424
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
2525
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
2626

@@ -93,6 +93,7 @@
9393
conf_dict.tpg_enabled = False
9494
conf_dict.n_df_apps = number_of_dataflow_apps
9595
conf_dict.fake_hsi_enabled = False
96+
conf_dict.remove_hdf5_files = True
9697

9798
conf_dict.config_substitutions.append(
9899
data_classes.attribute_substitution(
@@ -179,7 +180,7 @@
179180

180181
def test_dunerc_success(run_dunerc, caplog):
181182
# checks for run control success, problems during pytest setup, etc.
182-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False)
183+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=False)
183184

184185

185186
def test_log_files(run_dunerc):
@@ -220,30 +221,3 @@ def test_data_files(run_dunerc):
220221
data_file, fragment_check_list[jdx]
221222
)
222223
assert all_ok, "\N{POLICE CARS REVOLVING LIGHT} One or more data file checks failed! \N{POLICE CARS REVOLVING LIGHT}"
223-
224-
225-
def test_cleanup(run_dunerc):
226-
pathlist_string = ""
227-
filelist_string = ""
228-
for data_file in run_dunerc.data_files:
229-
filelist_string += " " + str(data_file)
230-
if str(data_file.parent) not in pathlist_string:
231-
pathlist_string += " " + str(data_file.parent)
232-
233-
if pathlist_string and filelist_string:
234-
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.integtest_debug):
235-
print("============================================")
236-
print("Listing the hdf5 files before deleting them:")
237-
print("============================================")
238-
239-
os.system(f"df -h {pathlist_string}")
240-
print("--------------------")
241-
os.system(f"ls -alF {filelist_string}")
242-
243-
for data_file in run_dunerc.data_files:
244-
data_file.unlink()
245-
246-
if run_dunerc.verbosity_helper.compare_level(IntegtestVerbosityLevels.integtest_debug):
247-
print("--------------------")
248-
os.system(f"df -h {pathlist_string}")
249-
print("============================================")

integtest/minimal_system_quick_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
import integrationtest.data_file_checks as data_file_checks
55
import integrationtest.log_file_checks as log_file_checks
6-
import integrationtest.basic_checks as basic_checks
76
import integrationtest.data_classes as data_classes
87
import integrationtest.resource_validation as resource_validation
98
import integrationtest.opmon_metric_checks as opmon_metric_checks
9+
import integrationtest.utility_functions as utility_functions
1010
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1111
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1212

@@ -114,7 +114,7 @@
114114

115115
def test_dunerc_success(run_dunerc, caplog):
116116
# checks for run control success, problems during pytest setup, etc.
117-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False)
117+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=False)
118118

119119

120120
def test_log_files(run_dunerc):

integtest/readout_type_scan_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import integrationtest.data_file_checks as data_file_checks
77
import integrationtest.log_file_checks as log_file_checks
8-
import integrationtest.basic_checks as basic_checks
98
import integrationtest.data_classes as data_classes
109
import integrationtest.resource_validation as resource_validation
10+
import integrationtest.utility_functions as utility_functions
1111
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1212
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1313

@@ -389,7 +389,7 @@
389389

390390
def test_dunerc_success(run_dunerc, caplog):
391391
# checks for run control success, problems during pytest setup, etc.
392-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=True)
392+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=True)
393393

394394

395395
def test_log_files(run_dunerc):

integtest/sample_ehn1_multihost_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232

3333
import integrationtest.data_file_checks as data_file_checks
3434
import integrationtest.log_file_checks as log_file_checks
35-
import integrationtest.basic_checks as basic_checks
3635
import integrationtest.data_classes as data_classes
36+
import integrationtest.utility_functions as utility_functions
3737
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
3838

3939
import functools
@@ -321,7 +321,7 @@ def test_dunerc_success(run_dunerc, capsys, caplog):
321321
# print("*** WARNING: the cleanup of stale _gunicorn_ process on np04-srv-028 did not succeed...")
322322

323323
# check on run control success, problems during pytest setup, etc.
324-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False)
324+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=False)
325325

326326

327327
def test_log_files(run_dunerc):

integtest/small_footprint_quick_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
import integrationtest.data_file_checks as data_file_checks
55
import integrationtest.log_file_checks as log_file_checks
6-
import integrationtest.basic_checks as basic_checks
76
import integrationtest.data_classes as data_classes
87
import integrationtest.resource_validation as resource_validation
8+
import integrationtest.utility_functions as utility_functions
99
from integrationtest.get_pytest_tmpdir import get_pytest_tmpdir
1010
from integrationtest.verbosity_helper import IntegtestVerbosityLevels
1111

@@ -98,7 +98,7 @@
9898

9999
def test_dunerc_success(run_dunerc, caplog):
100100
# checks for run control success, problems during pytest setup, etc.
101-
basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False)
101+
utility_functions.basic_checks(run_dunerc, caplog, print_test_name=False)
102102

103103
expected_max_time_sec = 65
104104
if run_dunerc.daq_session_overall_time > expected_max_time_sec:

0 commit comments

Comments
 (0)