Add test_duration info to results

This commit is contained in:
Alexandre Aubin 2021-01-03 21:06:47 +01:00
parent 428e082ab5
commit 37317c080c
3 changed files with 7 additions and 3 deletions

View file

@ -119,7 +119,7 @@ def level_6(tests):
def level_7(tests):
"""
All tests succeeded + no warning in linter (that part is tested by the
# linter which will report a "qualify_for_level_7" in successes)
linter which will report a "qualify_for_level_7" in successes)
"""
linter_tests = [t for t in tests if t["test_type"] == "PACKAGE_LINTER"]
@ -223,7 +223,8 @@ summary = {
"test_type": t["test_type"],
"test_arg": t["test_arg"],
"test_serie": t["test_serie"],
"main_result": t["results"]["main_result"]
"main_result": t["results"]["main_result"],
"test_duration": t["results"]["test_duration"]
} for t in tests],
"level_results": {level.level: level.passed for level in levels[1:]},
"level": global_level.level

View file

@ -177,7 +177,7 @@ stop_timer () {
[ $minutes -eq 1 ] && pminutes="${pminutes}, " || test -z "$pminutes" || pminutes="${pminutes}s, "
[ $seconds -gt 1 ] && pseconds="${pseconds}s" || pseconds="0s"
time="${phours}${pminutes}${pseconds} ($(date '+%T'))"
local time="${phours}${pminutes}${pseconds} ($(date '+%T'))"
if [ $1 -eq 2 ]; then
log_info "Working time for this test: $time"
elif [ $1 -eq 3 ]; then

View file

@ -321,6 +321,9 @@ TEST_LAUNCHER () {
[ $? -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result
local test_duration=$(echo $(( $(date +%s) - $global_start_timer )))
SET_RESULT "$test_duration" test_duration
break_before_continue
# Restore the started time for the timer