job_id = job['job_id']
status = job['status']
description = job['description']
- duration = int(job['duration'] or 0)
+ duration = seconds_to_hms(int(job['duration'] or 0))
# Every job gets a link to e.g. pulpito's pages
info_url = misc.get_results_url(run_name, job_id)
return email_templates['fail_templ'].format(**format_args)
+def seconds_to_hms(seconds):
+ (minutes, seconds) = divmod(seconds, 60)
+ (hours, minutes) = divmod(minutes, 60)
+ return "%02d:%02d:%02d" % (hours, minutes, seconds)
+
+
email_templates = {
'body_templ': dedent("""\
Test Run: {name}
'fail_templ': dedent("""\
[{job_id}] {desc}
-----------------------------------------------------------------
- time: {time}s{info_line}{log_line}{sentry_line}{reason_lines}
+ time: {time}{info_line}{log_line}{sentry_line}{reason_lines}
"""),
'info_url_templ': "\ninfo: {info}",
"""),
'pass_templ': dedent("""\
[{job_id}] {desc}
- time: {time}s{info_line}
+ time: {time}{info_line}
"""),
}
=================================================================
[88979] description for job with name test_name
-----------------------------------------------------------------
- time: 35190s
+ time: 09:46:30
info: http://example.com/test_name/88979/
log: http://qa-proxy.ceph.com/teuthology/test_name/88979/
=================================================================
[69152] description for job with name test_name
-----------------------------------------------------------------
- time: 5225s
+ time: 01:27:05
info: http://example.com/test_name/69152/
log: http://qa-proxy.ceph.com/teuthology/test_name/69152/
Pass
=================================================================
[68369] description for job with name test_name
- time: 33771s
+ time: 09:22:51
info: http://example.com/test_name/68369/
""").strip(),
}