From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4BACBA09DF; Fri, 13 Nov 2020 11:11:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0E71C87E; Fri, 13 Nov 2020 11:11:40 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1A1BAC86E for ; Fri, 13 Nov 2020 11:11:38 +0100 (CET) IronPort-SDR: T4txe/sqpwNJ5360JAVxa/lUzb6GSwrJeEbkukGEeZ27FAXw2bCz3eOgO6PLFNO161RBz+nFhc 6UIYLQBK3g+g== X-IronPort-AV: E=McAfee;i="6000,8403,9803"; a="166944168" X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="166944168" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2020 02:11:37 -0800 IronPort-SDR: vU5QY3RZCElmO0uzwm+U9if6RkQ4kLTcYEcsQsaToPhlmqlWBFzedZkixJ7U4F48OsTmYhM8HB cyLP0JyWoulw== X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="474612982" Received: from unknown (HELO localhost.localdomain) ([10.240.183.57]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Nov 2020 02:11:35 -0800 From: Haiyang Zhao To: dts@dpdk.org, lijuan.tu@intel.com Cc: Haiyang Zhao Date: Fri, 13 Nov 2020 18:06:05 +0800 Message-Id: <20201113100605.20669-3-haiyangx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201113100605.20669-1-haiyangx.zhao@intel.com> References: <20201113100605.20669-1-haiyangx.zhao@intel.com> Subject: [dts] [PATCH V1 2/2] framework/excel_reporter: fix issue of msg exceed xlwt maximum cell length X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" truncate msg length if it exceed xlwt maximun cell legth in case of saving result failed and DTS terminated. Signed-off-by: Haiyang Zhao --- framework/excel_reporter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/excel_reporter.py b/framework/excel_reporter.py index 5b8e4cf..65d26b6 100644 --- a/framework/excel_reporter.py +++ b/framework/excel_reporter.py @@ -167,7 +167,7 @@ class ExcelReporter(object): self.sheet.write(self.row, self.col + 1, result) else: self.sheet.write( - self.row, self.col + 1, result, self.failed_style) + self.row, self.col + 1, result if len(result) < 5000 else result[:2000] + '\r\n...\r\n...\r\n...\r\n' + result[-2000:], self.failed_style) def __write_cases(self, dut, target, suite): for case in set(self.result.all_test_cases(dut, target, suite)): @@ -198,7 +198,7 @@ class ExcelReporter(object): def __write_failed_target(self, dut, target): msg = "TARGET ERROR '%s'" % self.result.target_failed_msg(dut, target) - self.sheet.write(self.row, self.col + 4, msg, self.failed_style) + self.sheet.write(self.row, self.col + 4, msg if len(msg) < 5000 else msg[:2000] + '\r\n...\r\n...\r\n...\r\n' + msg[-2000:], self.failed_style) self.row += 1 def __write_targets(self, dut): @@ -214,7 +214,7 @@ class ExcelReporter(object): def __write_failed_dut(self, dut): msg = "PREREQ FAILED '%s'" % self.result.dut_failed_msg(dut) - self.sheet.write(self.row, self.col + 5, msg, self.failed_style) + self.sheet.write(self.row, self.col + 5, msg if len(msg) < 5000 else msg[:2000] + '\r\n...\r\n...\r\n...\r\n' + msg[-2000:], self.failed_style) self.row += 1 def __parse_result(self): -- 2.17.1