From patchwork Wed May 4 05:40:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 752612 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p445eS4m009127 for ; Wed, 4 May 2011 05:40:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752068Ab1EDFkZ (ORCPT ); Wed, 4 May 2011 01:40:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9287 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898Ab1EDFkY (ORCPT ); Wed, 4 May 2011 01:40:24 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p445eN7g013144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 4 May 2011 01:40:23 -0400 Received: from freedom.redhat.com (vpn-8-36.rdu.redhat.com [10.11.8.36]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p445eLQF017599; Wed, 4 May 2011 01:40:22 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] HTML report: Handle errors when trying to determine test length Date: Wed, 4 May 2011 02:40:23 -0300 Message-Id: <1304487623-28981-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 04 May 2011 05:40:28 +0000 (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 --- client/tools/html_report.py | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) 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