From patchwork Mon Dec 31 03:55:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 10745269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A13AD6C2 for ; Mon, 31 Dec 2018 03:55:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F8FE28B37 for ; Mon, 31 Dec 2018 03:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CCF528B82; Mon, 31 Dec 2018 03:55:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB7128B37 for ; Mon, 31 Dec 2018 03:55:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725953AbeLaDzS (ORCPT ); Sun, 30 Dec 2018 22:55:18 -0500 Received: from mail-eopbgr740121.outbound.protection.outlook.com ([40.107.74.121]:6077 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725935AbeLaDzR (ORCPT ); Sun, 30 Dec 2018 22:55:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8jWgQqBly5x2Mb4diiPlme7unnBGGwW8bhgEgu9Ku7g=; b=PsFVPMUBAtqv7aphsclf0CkXIF/BTReIbhik3XBOW/xwbpWSuQ4AprsL/pKr5CXk9qDu7160gdkV8ozZcg74Emj7ymeaS+yTVpSNK0EsO4xsV8FT/FG5R4XXOyYysHUOoGs5b5z/iRPakg7mmW4V1bkE3eyqpzD0C32HzCMwYVE= Received: from BL0PR0102CA0032.prod.exchangelabs.com (2603:10b6:207:18::45) by BYAPR01MB5525.prod.exchangelabs.com (2603:10b6:a03:123::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1471.20; Mon, 31 Dec 2018 03:55:13 +0000 Received: from BY2NAM03FT004.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::200) by BL0PR0102CA0032.outlook.office365.com (2603:10b6:207:18::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1471.20 via Frontend Transport; Mon, 31 Dec 2018 03:55:12 +0000 Authentication-Results: spf=pass (sender IP is 18.9.28.11) smtp.mailfrom=mit.edu; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=mit.edu; Received-SPF: Pass (protection.outlook.com: domain of mit.edu designates 18.9.28.11 as permitted sender) receiver=protection.outlook.com; client-ip=18.9.28.11; helo=outgoing.mit.edu; Received: from outgoing.mit.edu (18.9.28.11) by BY2NAM03FT004.mail.protection.outlook.com (10.152.84.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1471.13 via Frontend Transport; Mon, 31 Dec 2018 03:55:11 +0000 Received: from callcc.thunk.org ([208.250.98.2]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id wBV3tACR028421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 30 Dec 2018 22:55:10 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id CF9C27A491A; Sun, 30 Dec 2018 22:55:09 -0500 (EST) From: Theodore Ts'o To: CC: Theodore Ts'o Subject: [PATCH] report: gracefully handle XML report creation when no tests are run Date: Sun, 30 Dec 2018 22:55:07 -0500 Message-ID: <20181231035507.10530-1-tytso@mit.edu> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:18.9.28.11;IPV:CAL;SCL:-1;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10019020)(39860400002)(376002)(136003)(346002)(396003)(2980300002)(199004)(189003)(6266002)(2616005)(2906002)(5660300001)(36756003)(2870700001)(47776003)(14444005)(88552002)(52956003)(305945005)(90966002)(356004)(86362001)(1076003)(4326008)(8676002)(106466001)(126002)(246002)(50226002)(476003)(50466002)(42186006)(48376002)(478600001)(36906005)(486006)(51416003)(26826003)(26005)(186003)(336012)(6916009)(316002)(2351001)(106002)(75432002)(8936002)(786003)(103686004);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR01MB5525;H:outgoing.mit.edu;FPR:;SPF:Pass;LANG:en;PTR:outgoing-auth-1.mit.edu;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2NAM03FT004;1:P2s5JRAJhvbvNvvPvRqUBE90PfIvWXLSUksTSRgbNrDcOn/1RZ5704/alJ8bfMWS8v8jjSPVsyxTHl1CRbQ7Z5eZMylhH/Lkr57HahjqjRuE/6+soOSxM4ivue1RX3LB X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b20f44a7-800a-4162-d93a-08d66ed3c3ca X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4608076)(4709027)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR: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Microsoft-Exchange-Diagnostics: 1;BYAPR01MB5525;20:LeP/jwGdA9Wgt1Sw9MnkzHxVSciiMB/oYqxaQYM5e/hzxc8A7w+dkdSqWg4gQUCoGSduyHRr2izQw9dl2smy6FqKFsJicb90+t3WvTE6aD4huSox1t4t2U9hOHAfcbcjwb7LDu3QJpDWb1t4wv6/VmvnZJVobOaAB5d6kzZ/2KwyMWymlrM1ortn6pqc9fQnUHZoJyegsVX64G/Sx0uAXil7U8i+wdkHSZZFe1FTEMQVj8Cd2b2xj2tToiPs1QNQVGBDm4bHX+rpBSVjLOLNTu3vEPKey8W7O/q/rbePX5aUHchl7hrukma5CgKAlcIB8JUslClCjVORKzkgs52MGzwU/SLVREG4Hq4yv88gqS5xnoJUYZ5Qvtyg0NShPQSc+sc+Q3YQGR9HjmPLtkUCoArg2V4GQ65kNShdnC93MjHVkzNrB8VIfoD640x+GsYaM8h6tL6wqYWjqHMkVLyKt/nUM1Z70iSWPR9EjyiCwWNMKiuywcWLO+89cK3cpkqa;4:IPc8EHwPvuGgoPPzjjfuQi5xAQVjTHasovz8xTwrdC8yKDpehJW17iXkbMZP/M4WFVYfRL5Ewt4Kv2ndPFYEMHrlcLvNGkzOzQiwz+3noqdkJ7/Vfj6/zaEZIgcSnfpc3TdOizRnFc1cJ+4x6LLq7D6oJAFTC3Tl67UnOEG4JWRKhSymWw56yq2giZhBs/Q4f3SpVDNEC61XV3BEvg77yGCTTZauAOGGlHrKr16v6MpDnyJpINo/J0cb0BS5hpJyAelOuTv24YK03O8U4U2NXQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(3231475)(944501520)(52105112)(93006095)(93004095)(10201501046)(3002001)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(201702281529075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:B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+KnjONNJ1Nd/dgHsb0dzeG6UmS07nJiXXxQDxxzUYojEcOk/eadFnwziiTtoavl/E4EsgdwSnkuGcOe0UexIVLw2u4ijVfAtjYDxzk+hyFX+C/U=;7:f2bI0oAH69Z3Gm9d7IBkNb4BR2/4UQewdPP/QpNd0klF5sKmdPzgAEbhmGQf39alvtYV8uQOfiblJVTp+p9av96mHtYqx4tHmzxvC+3x4wfDn1FXYP+JQ8x3nftj/08beDxQXkwdWfLqSgXRHXXt/Q== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: mit.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Dec 2018 03:55:11.8384 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b20f44a7-800a-4162-d93a-08d66ed3c3ca X-MS-Exchange-CrossTenant-Id: 64afd9ba-0ecf-4acf-bc36-935f6235ba8b X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=64afd9ba-0ecf-4acf-bc36-935f6235ba8b;Ip=[18.9.28.11];Helo=[outgoing.mit.edu] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR01MB5525 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If no tests are run (because they have all been excluded) then make sure we insert a valid timestamp into the XML file, and avoid printing an error message when reading a non-existent test summary scratch file. Signed-off-by: Theodore Ts'o --- common/report | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/report b/common/report index fb00b402..6cac71fc 100644 --- a/common/report +++ b/common/report @@ -59,6 +59,9 @@ _xunit_make_section_report() local report=$tmp.report.xunit.$sect_name.xml # Header echo "" > $REPORT_DIR/result.xml + if [ -z "$date_time" ]; then + date_time=$(date +"%F %T") + fi local dtime=`echo $date_time| tr " " 'T'` local stats="failures=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\"" local hw_info="hostname=\"$HOST\" timestamp=\"$dtime\" " @@ -70,7 +73,9 @@ _xunit_make_section_report() _xunit_add_property "$p" done echo -e "\t" >> $REPORT_DIR/result.xml - cat $tmp.report.xunit.$sect_name.xml >> $REPORT_DIR/result.xml + if [ -f $report ]; then + cat $report >> $REPORT_DIR/result.xml + fi echo "" >> $REPORT_DIR/result.xml echo "Xunit report: $REPORT_DIR/result.xml" }