|
4 | 4 |
|
5 | 5 | import integrationtest.data_file_checks as data_file_checks |
6 | 6 | import integrationtest.log_file_checks as log_file_checks |
| 7 | +import integrationtest.basic_checks as basic_checks |
7 | 8 | import integrationtest.data_classes as data_classes |
| 9 | +from integrationtest.verbosity_helper import IntegtestVerbosityLevels |
| 10 | + |
| 11 | +import functools |
| 12 | +print = functools.partial(print, flush=True) # always flush print() output |
8 | 13 |
|
9 | 14 | pytest_plugins = "integrationtest.integrationtest_drunc" |
10 | 15 |
|
|
72 | 77 |
|
73 | 78 | # The next three variable declarations *must* be present as globals in the test |
74 | 79 | # file. They're read by the "fixtures" in conftest.py to determine how |
75 | | -# to run the config generation and nanorc |
| 80 | +# to run the config generation and drunc |
76 | 81 |
|
77 | 82 | # The arguments to pass to the config generator, excluding the json |
78 | 83 | # output directory (the test framework handles that) |
|
107 | 112 | ) |
108 | 113 |
|
109 | 114 | confgen_arguments = {"MinimalSystem": conf_dict} |
110 | | -# The commands to run in nanorc, as a list |
111 | | -nanorc_command_list = ( |
| 115 | +# The commands to run in dunerc, as a list |
| 116 | +dunerc_command_list = ( |
112 | 117 | "boot conf".split() |
113 | 118 | + " start --run-number 101 wait 1 enable-triggers wait 2 disable-triggers wait 2 drain-dataflow stop-trigger-sources stop wait 2".split() |
114 | 119 | + " start --run-number 102 wait 1 change-rate --trigger-rate 2.0 enable-triggers wait 1 disable-triggers wait 2 drain-dataflow stop-trigger-sources stop wait 2".split() |
|
120 | 125 | # The tests themselves |
121 | 126 |
|
122 | 127 |
|
123 | | -def test_nanorc_success(run_nanorc): |
124 | | - # print the name of the current test |
125 | | - current_test = os.environ.get("PYTEST_CURRENT_TEST") |
126 | | - match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test) |
127 | | - if match_obj: |
128 | | - current_test = match_obj.group(1) |
129 | | - banner_line = re.sub(".", "=", current_test) |
130 | | - print(banner_line) |
131 | | - print(current_test) |
132 | | - print(banner_line) |
133 | | - |
134 | | - # Check that nanorc completed correctly |
135 | | - assert run_nanorc.completed_process.returncode == 0 |
| 128 | +def test_dunerc_success(run_dunerc, caplog): |
| 129 | + # check for run control success, problems during pytest setup, etc. |
| 130 | + basic_checks.basic_checks(run_dunerc, caplog, print_test_name=False) |
136 | 131 |
|
137 | 132 |
|
138 | | -def test_log_files(run_nanorc): |
| 133 | +def test_log_files(run_dunerc): |
139 | 134 | if check_for_logfile_errors: |
140 | 135 | # Check that there are no warnings or errors in the log files |
141 | 136 | assert log_file_checks.logs_are_error_free( |
142 | | - run_nanorc.log_files, True, True, ignored_logfile_problems |
| 137 | + run_dunerc.log_files, True, True, ignored_logfile_problems, |
| 138 | + verbosity_helper=run_dunerc.verbosity_helper |
143 | 139 | ) |
144 | 140 |
|
145 | 141 |
|
146 | | -def test_data_files(run_nanorc): |
| 142 | +def test_data_files(run_dunerc): |
147 | 143 | # Run some tests on the output data file |
148 | | - assert len(run_nanorc.data_files) == expected_number_of_data_files |
| 144 | + assert len(run_dunerc.data_files) == expected_number_of_data_files |
149 | 145 |
|
150 | 146 | fragment_check_list = [triggercandidate_frag_params, hsi_frag_params] |
151 | 147 | # fragment_check_list.append(wib1_frag_hsi_trig_params) # ProtoWIB |
152 | 148 | # fragment_check_list.append(wib2_frag_params) # DuneWIB |
153 | 149 | fragment_check_list.append(wibeth_frag_params) # WIBEth |
154 | 150 |
|
155 | | - for idx in range(len(run_nanorc.data_files)): |
156 | | - data_file = data_file_checks.DataFile(run_nanorc.data_files[idx]) |
| 151 | + for idx in range(len(run_dunerc.data_files)): |
| 152 | + data_file = data_file_checks.DataFile(run_dunerc.data_files[idx], run_dunerc.verbosity_helper) |
157 | 153 | assert data_file_checks.sanity_check(data_file) |
158 | 154 | assert data_file_checks.check_file_attributes(data_file) |
159 | 155 | assert data_file_checks.check_event_count( |
|
0 commit comments