From patchwork Wed Jun 21 14:14:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9801947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 708896086C for ; Wed, 21 Jun 2017 14:16:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61D9B26222 for ; Wed, 21 Jun 2017 14:16:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5665A28389; Wed, 21 Jun 2017 14:16:43 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4748269A3 for ; Wed, 21 Jun 2017 14:16:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNgP3-0005Bn-15; Wed, 21 Jun 2017 14:14:41 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dNgP1-000573-R6 for xen-devel@lists.xenproject.org; Wed, 21 Jun 2017 14:14:39 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id B0/EC-03371-F4F7A495; Wed, 21 Jun 2017 14:14:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeJIrShJLcpLzFFi42JxWrohUte/3iv SoOEnj8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmtEw8ThzwRmxiraFM1gaGBcKdjFyckgI+Etc +r2ZHcRmE9CVaNryl62LkYNDREBF4vZeAxCTWSBUYscLS5AKYQE7iQdfpzCD2CwCqhLbj7eAd fIKeEk03L3OBDFRTuL88Z/MIK2cQPHFj/xBTCEBT4n5p/wgTDWJuevjIRoFJU7OfMICYjMLSE gcfPGCeQIj7ywkqVlIUgsYmVYxahSnFpWlFukameolFWWmZ5TkJmbm6BoamOnlphYXJ6an5iQ mFesl5+duYgSGDAMQ7GBctSDwEKMkB5OSKG+5t1ekEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQne k7VAOcGi1PTUirTMHGDwwqQlOHiURHjXlACleYsLEnOLM9MhUqcYFaXEeU+A9AmAJDJK8+DaY BFziVFWSpiXEegQIZ6C1KLczBJU+VeM4hyMSsK8B2uApvBk5pXATX8FtJgJaPGLIx4gi0sSEV JSDYxCD5ff25Zlqnb0uRWXiFW7QGTBvbPzPHd6CZ5cWDbbMfFNxevTxide9p2/Pm93781XH5e +D4jufN19J1FWRGdi4LfsRdkfL/5ekvzp9/Fk36XL3fQeLr59ZubDCc5WzzQurSzs/dVztT+l 3SHrle/16mmPvtxwurP9xuQGzSbz/g07O74e3370jxJLcUaioRZzUXEiAAx9bB6TAgAA X-Env-Sender: prvs=33896ecda=Ian.Jackson@citrix.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1498054474!99281155!3 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44626 invoked from network); 21 Jun 2017 14:14:38 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 21 Jun 2017 14:14:38 -0000 X-IronPort-AV: E=Sophos;i="5.39,369,1493683200"; d="scan'208";a="428818123" From: Ian Jackson To: Date: Wed, 21 Jun 2017 15:14:04 +0100 Message-ID: <1498054447-11281-13-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1498054447-11281-1-git-send-email-ian.jackson@eu.citrix.com> References: <1498054447-11281-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 12/15] sg-run-job: Abolish `anyfailed' X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is very similar to !$ok. anyfailed is set to 1 only by catching-otherwise, which also then sets ok to 0. The differences are solely some sites which set ok to 0 without setting anyfailed to 1: (i) In run-job, if there are escaped steps (ii) In run-job, if any steps were not run due to the skip_testids or truncate_testids runvars job is being truncated due to (iii) If a per-host-ts step fails The only places where anyfailed was used were: * To decide whether to do log capture in build jobs. This happens before (i) and (ii); and (iii) is not applicable because it only applies if $need_xen_hosts is nonempty which is never true if $need_build_host is false. We can simply use $ok instead, without any functional change. * In printing a message to stdout at the end of the job. We update this use site to use $ok and change the message accordingly. So overall, no functional change other than to a message in the transcript. Signed-off-by: Ian Jackson --- sg-run-job | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sg-run-job b/sg-run-job index 654ba83..b1f94f4 100755 --- a/sg-run-job +++ b/sg-run-job @@ -40,13 +40,12 @@ proc per-host-finish {} { } proc run-job {job} { - global jobinfo builds flight ok truncate need_xen_hosts anyfailed + global jobinfo builds flight ok truncate need_xen_hosts global nested_layers_hosts truncate_globs skip_globs anyskipped set ok 1 set truncate 0 set anyskipped 0 - set anyfailed 0 jobdb::prepare $job set truncate_globs [jobdb::read-runvar $flight $job truncate_testids] @@ -96,7 +95,7 @@ proc run-job {job} { set need_xen_hosts [lunappend nested_layers_hosts] } - if {$need_build_host && $anyfailed} { + if {$need_build_host && !$ok} { run-ts !broken capture-logs ts-logs-capture + host } @@ -119,8 +118,8 @@ proc run-job {job} { if {$need_build_host && $ok} { jobdb::preserve-task 90 } - if {$anyfailed} { - jobdb::logputs stdout "at least one test failed" + if {!$ok} { + jobdb::logputs stdout "job not ok" } } @@ -128,9 +127,9 @@ proc catching-otherwise {failst script} { # Executes $script. # If job is already a failure (ie not $ok), skips it (ie does nothing). # If any Tcl exception is thrown, declares the job a failure. - # (ie sets job status to $failst, and sets anyfailed to 1 and ok to 0) + # (ie sets job status to $failst, and sets ok to 0) - global anyfailed flight jobinfo ok + global flight jobinfo ok if {!$ok} return @@ -139,7 +138,6 @@ proc catching-otherwise {failst script} { } emsg]} { jobdb::logputs stderr "$flight.$jobinfo(job) $script failed: $emsg" set ok 0 - set anyfailed 1 setstatus $failst } }