From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 37ADE1F8C6 for ; Thu, 5 Aug 2021 07:53:03 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5F84C384601D for ; Thu, 5 Aug 2021 07:53:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F84C384601D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628149982; bh=vtnme6zsFx6MVE7z98T+KbfjrtZ0HVb6rW4DiikKyhs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=yGrLuGVGbB0P82LQuHFd3ZVgK/Rkab0pO0hF2T51cVmr43gwsO10BZR6qIln+h0/4 z4M+7g7EfZPFNywvA1a+LBgudJ2u8u05GWUPkYOYvGy97SL5JXfutdPXLnfumqFqPm hqL6nyLTjBh5kiAQ/GrIi9e4Iew6LYj/xMwY1NIg= Received: from esa2.hc1455-7.c3s2.iphmx.com (esa2.hc1455-7.c3s2.iphmx.com [207.54.90.48]) by sourceware.org (Postfix) with ESMTPS id BF9CF3988403 for ; Thu, 5 Aug 2021 07:51:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF9CF3988403 IronPort-SDR: b8J++oZwoSEgyF1kw8RjcNyPPlzoN6cq7pGkXtMYxqUa1SHG1cEfmmC3wVrrRTQKmPiDI7MnL9 KeMnP/MNktSdgxGU1a8mw/QhTmDOXFEfOkpp3ZOB0rBt+BcqMHsG50xg+qEBC5YJQMErvFozHG czl1kbsY2SHBCOfFHUPRYldiU5305+oLBjm4SMUCGQm6e+DqK4l5evjRM3ZSMx4Sf8yATrLgCT sh/UF/WIrSgTJisPHq49ytT5a0tFn4wsDvngOCqGrsinb5piw4T+mYcze0fBzTkkW9VyZqQMYL sMRki08qXFM/IPQK2EPNiCIu X-IronPort-AV: E=McAfee;i="6200,9189,10066"; a="39081497" X-IronPort-AV: E=Sophos;i="5.84,296,1620658800"; d="scan'208";a="39081497" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa2.hc1455-7.c3s2.iphmx.com with ESMTP; 05 Aug 2021 16:51:53 +0900 Received: from oym-m1.gw.nic.fujitsu.com (oym-nat-oym-m1.gw.nic.fujitsu.com [192.168.87.58]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 4D66A1CFC6F for ; Thu, 5 Aug 2021 16:51:52 +0900 (JST) Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by oym-m1.gw.nic.fujitsu.com (Postfix) with ESMTP id 7DCA3E6BA0 for ; Thu, 5 Aug 2021 16:51:51 +0900 (JST) Received: from bionic.lxd (unknown [10.126.53.116]) by m3051.s.css.fujitsu.com (Postfix) with ESMTP id 667D1A1; Thu, 5 Aug 2021 16:51:51 +0900 (JST) To: libc-alpha@sourceware.org Subject: [PATCH v3 4/5] benchtests: Fix validate_benchout.py exceptions Date: Thu, 5 Aug 2021 07:51:44 +0000 Message-Id: <20210805075144.433644-1-naohirot@fujitsu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210805074733.433430-1-naohirot@fujitsu.com> References: <20210805074733.433430-1-naohirot@fujitsu.com> X-TM-AS-GCONF: 00 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Naohiro Tamura via Libc-alpha Reply-To: Naohiro Tamura Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" This patch fixed validate_benchout.py two exceptions, AttributeError if benchout_strings.schema.json is specified and json.decoder.JSONDecodeError if benchout is not JSON. --- benchtests/scripts/import_bench.py | 5 ++++- benchtests/scripts/validate_benchout.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py index a799b4e1b7dc..e3337ca5d638 100644 --- a/benchtests/scripts/import_bench.py +++ b/benchtests/scripts/import_bench.py @@ -104,7 +104,10 @@ def do_for_all_timings(bench, callback): """ for func in bench['functions'].keys(): for k in bench['functions'][func].keys(): - if 'timings' not in bench['functions'][func][k].keys(): + try: + if 'timings' not in bench['functions'][func][k].keys(): + continue + except AttributeError: continue callback(bench, func, k) diff --git a/benchtests/scripts/validate_benchout.py b/benchtests/scripts/validate_benchout.py index 47df33ed0252..00d5fa0ee5eb 100755 --- a/benchtests/scripts/validate_benchout.py +++ b/benchtests/scripts/validate_benchout.py @@ -73,11 +73,15 @@ def main(args): except bench.validator.ValidationError as e: return print_and_exit("Invalid benchmark output: %s" % e.message, - os.EX_DATAERR) + os.EX_DATAERR) except bench.validator.SchemaError as e: return print_and_exit("Invalid schema: %s" % e.message, os.EX_DATAERR) + except json.decoder.JSONDecodeError as e: + return print_and_exit("Benchmark output in %s is not JSON." % args[0], + os.EX_DATAERR) + print("Benchmark output in %s is valid." % args[0]) return os.EX_OK -- 2.17.1