Skip to content

Commit dd6dac6

Browse files
committed
Stateless tests: better sort checks in test report
1 parent f30cd12 commit dd6dac6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docker/test/util/process_functional_tests_result.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,20 @@ def write_results(results_file, status_file, results, status):
228228
state, description, test_results = process_result(args.in_results_dir, broken_tests)
229229
logging.info("Result parsed")
230230
status = (state, description)
231+
232+
def test_result_comparator(item):
233+
# sort by status then by check name
234+
order = {
235+
"FAIL": 0,
236+
"Timeout": 1,
237+
"NOT_FAILED": 2,
238+
"BROKEN": 3,
239+
"OK": 4,
240+
"SKIPPED": 5,
241+
}
242+
return order.get(item[1], 10), str(item[0]), item[1]
243+
244+
test_results.sort(key=test_result_comparator)
245+
231246
write_results(args.out_results_file, args.out_status_file, test_results, status)
232247
logging.info("Result written")

0 commit comments

Comments
 (0)