Skip to content

Commit e827ce2

Browse files
Fix regression testing false negative
The QoR parsing script returned -1 in case of a mismatch between arch file name in the actual run and the golden results. If there was 1 run failures, the -1 would cancel the 1 and as a result the regression tests would pass while having errors. This commit fixes that by not throwing an exception in that specific case (Therefore not returning -1) and taking the absolute value of the QoR and run failures.
1 parent 0511c6d commit e827ce2

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

run_reg_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ def vtr_command_main(arg_list, prog=None):
199199
print("All tests passed")
200200
elif tests_run and total_num_func_failures != 0 or total_num_qor_failures != 0:
201201
print("Error: {} tests failed".format(total_num_func_failures + total_num_qor_failures))
202-
203-
sys.exit(total_num_func_failures + total_num_qor_failures)
202+
203+
# If the QoR parsing script throws an exception, it returns -1. This could potentially cancel a run failure and result in a false negative.
204+
# Absolute value is taken to avoid that.
205+
sys.exit(abs(total_num_func_failures) + abs(total_num_qor_failures))
204206

205207

206208
def display_qor(reg_test):

vtr_flow/scripts/python_libs/vtr/parse_vtr_task.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,14 +422,6 @@ def check_two_files(
422422
for (arch, circuit, script_params), _ in first_results.all_metrics().items():
423423
first_primary_keys.append((arch, circuit, script_params))
424424

425-
# Ensure that first result file has all the second result file cases
426-
for arch, circuit, script_params in second_primary_keys:
427-
if first_results.metrics(arch, circuit, script_params) is None:
428-
raise InspectError(
429-
"Required case {}/{} missing from {} results: {}".format(
430-
arch, circuit, first_name, first_results_filepath
431-
)
432-
)
433425

434426
# Warn about any elements in first result file that are not found in second result file
435427
for arch, circuit, script_params in first_primary_keys:
@@ -444,6 +436,14 @@ def check_two_files(
444436
for arch, circuit, script_params in second_primary_keys:
445437
second_metrics = second_results.metrics(arch, circuit, script_params)
446438
first_metrics = first_results.metrics(arch, circuit, script_params)
439+
440+
if first_metrics == None:
441+
num_qor_failures += 1
442+
print("Required case {}/{} missing from {} results: {}".format(
443+
arch, circuit, first_name, first_results_filepath
444+
))
445+
continue
446+
447447
first_fail = True
448448
for metric in pass_requirements.keys():
449449

0 commit comments

Comments
 (0)