Skip to content

Commit 52ec340

Browse files
authored
Merge pull request #472 from DUNE-DAQ/kbiery/banner_consistency
Improved the consistency of the handling of the banner line in the in…
2 parents 174d306 + adc174d commit 52ec340

8 files changed

+40
-10
lines changed

integtest/disabled_output_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,16 @@
167167

168168

169169
def test_nanorc_success(run_nanorc):
170+
# print the name of the current test
170171
current_test = os.environ.get("PYTEST_CURRENT_TEST")
171-
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
172+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
172173
if match_obj:
173174
current_test = match_obj.group(1)
174175
banner_line = re.sub(".", "=", current_test)
175176
print(banner_line)
176177
print(current_test)
177178
print(banner_line)
179+
178180
# Check that nanorc completed correctly
179181
assert run_nanorc.completed_process.returncode == 0
180182

integtest/hdf5_compression_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import os
33
import re
4-
import copy
54
import urllib.request
65

76
import integrationtest.data_file_checks as data_file_checks
@@ -254,14 +253,16 @@ def test_nanorc_success(run_nanorc):
254253
resval_summary_string = resval.get_insufficient_resources_summary()
255254
pytest.skip(f"{resval_summary_string}")
256255

256+
# print the name of the current test
257257
current_test = os.environ.get("PYTEST_CURRENT_TEST")
258-
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
258+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
259259
if match_obj:
260260
current_test = match_obj.group(1)
261261
banner_line = re.sub(".", "=", current_test)
262262
print(banner_line)
263263
print(current_test)
264264
print(banner_line)
265+
265266
# Check that nanorc completed correctly
266267
assert run_nanorc.completed_process.returncode == 0
267268

integtest/insufficient_disk_space_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,16 @@ def test_nanorc_success(run_nanorc):
170170
resval_summary_string = resval.get_insufficient_resources_summary()
171171
pytest.skip(f"{resval_summary_string}")
172172

173+
# print the name of the current test
173174
current_test = os.environ.get("PYTEST_CURRENT_TEST")
174-
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
175+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
175176
if match_obj:
176177
current_test = match_obj.group(1)
177178
banner_line = re.sub(".", "=", current_test)
178179
print(banner_line)
179180
print(current_test)
180181
print(banner_line)
182+
181183
# Check that nanorc completed correctly
182184
assert run_nanorc.completed_process.returncode == 0
183185

integtest/large_trigger_record_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,16 @@ def test_nanorc_success(run_nanorc):
186186
resval_summary_string = resval.get_insufficient_resources_summary()
187187
pytest.skip(f"{resval_summary_string}")
188188

189+
# print the name of the current test
189190
current_test = os.environ.get("PYTEST_CURRENT_TEST")
190-
match_obj = re.search(r".*\[(.+)\-run_nanorc0].*", current_test)
191+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
191192
if match_obj:
192193
current_test = match_obj.group(1)
193194
banner_line = re.sub(".", "=", current_test)
194195
print(banner_line)
195196
print(current_test)
196197
print(banner_line)
198+
197199
# Check that nanorc completed correctly
198200
assert run_nanorc.completed_process.returncode == 0
199201

integtest/max_file_size_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import os
33
import re
4-
import copy
54
import urllib.request
65

76
import integrationtest.data_file_checks as data_file_checks
@@ -230,14 +229,16 @@ def test_nanorc_success(run_nanorc):
230229
resval_summary_string = resval.get_insufficient_resources_summary()
231230
pytest.skip(f"{resval_summary_string}")
232231

232+
# print the name of the current test
233233
current_test = os.environ.get("PYTEST_CURRENT_TEST")
234-
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
234+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
235235
if match_obj:
236236
current_test = match_obj.group(1)
237237
banner_line = re.sub(".", "=", current_test)
238238
print(banner_line)
239239
print(current_test)
240240
print(banner_line)
241+
241242
# Check that nanorc completed correctly
242243
assert run_nanorc.completed_process.returncode == 0
243244

integtest/multiple_data_writers_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
22
import os
33
import re
4-
import copy
54
import urllib.request
65

76
import integrationtest.data_file_checks as data_file_checks
@@ -151,14 +150,16 @@ def test_nanorc_success(run_nanorc):
151150
resval_summary_string = resval.get_insufficient_resources_summary()
152151
pytest.skip(f"{resval_summary_string}")
153152

153+
# print the name of the current test
154154
current_test = os.environ.get("PYTEST_CURRENT_TEST")
155-
match_obj = re.search(r".*\[(.+)-run_nanorc0\].*", current_test)
155+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
156156
if match_obj:
157157
current_test = match_obj.group(1)
158158
banner_line = re.sub(".", "=", current_test)
159159
print(banner_line)
160160
print(current_test)
161161
print(banner_line)
162+
162163
# Check that nanorc completed correctly
163164
assert run_nanorc.completed_process.returncode == 0
164165

integtest/offline_prod_run_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import pytest
2+
import os
3+
import re
24
import urllib.request
35

46
import integrationtest.data_file_checks as data_file_checks
@@ -97,6 +99,16 @@
9799

98100

99101
def test_nanorc_success(run_nanorc):
102+
# print the name of the current test
103+
current_test = os.environ.get("PYTEST_CURRENT_TEST")
104+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
105+
if match_obj:
106+
current_test = match_obj.group(1)
107+
banner_line = re.sub(".", "=", current_test)
108+
print(banner_line)
109+
print(current_test)
110+
print(banner_line)
111+
100112
# Check that nanorc completed correctly
101113
assert run_nanorc.completed_process.returncode == 0
102114

integtest/trmonrequestor_test.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import pytest
33
import os
44
import re
5-
import copy
65

76
import integrationtest.data_file_checks as data_file_checks
87
import integrationtest.log_file_checks as log_file_checks
@@ -103,6 +102,16 @@ def make_run_command_list(runnum):
103102

104103
# The tests themselves
105104
def test_nanorc_success(run_nanorc):
105+
# print the name of the current test
106+
current_test = os.environ.get("PYTEST_CURRENT_TEST")
107+
match_obj = re.search(r".*\[(.+)-run_.*rc.*\d].*", current_test)
108+
if match_obj:
109+
current_test = match_obj.group(1)
110+
banner_line = re.sub(".", "=", current_test)
111+
print(banner_line)
112+
print(current_test)
113+
print(banner_line)
114+
106115
# Check that nanorc completed correctly
107116
assert run_nanorc.completed_process.returncode == 0
108117

0 commit comments

Comments
 (0)