diff mbox

HTML report: Handle errors when trying to determine test length

Message ID 1304487623-28981-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues May 4, 2011, 5:40 a.m. UTC
Some test like operations (like a kernel booting), the status
log does not contain test lenght info. So handle accordingly
and mark on report as 'Unknown'.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
 client/tools/html_report.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/client/tools/html_report.py b/client/tools/html_report.py
index 7b17a75..c4e97b2 100755
--- a/client/tools/html_report.py
+++ b/client/tools/html_report.py
@@ -1572,10 +1572,13 @@  def parse_result(dirname, line):
             result['log'] = get_exec_log(dirname, tag)
         if len(stimelist)>0:
             pair = parts[4].split('=')
-            etime = int(pair[1])
-            stime = stimelist.pop()
-            total_exec_time_sec = etime - stime
-            result['exec_time_sec'] = total_exec_time_sec
+            try:
+                etime = int(pair[1])
+                stime = stimelist.pop()
+                total_exec_time_sec = etime - stime
+                result['exec_time_sec'] = total_exec_time_sec
+            except ValueError:
+                result['exec_time_sec'] = "Unknown"
         return result
     return None