From patchwork Thu Feb 8 02:01:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 870705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zcM3W5VzFz9t42 for ; Thu, 8 Feb 2018 13:05:27 +1100 (AEDT) Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zcM3W3vGdzF15T for ; Thu, 8 Feb 2018 13:05:27 +1100 (AEDT) X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=au1.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=andrew.donnellan@au1.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zcLzj2DPkzF15l for ; Thu, 8 Feb 2018 13:02:08 +1100 (AEDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1820LRa187249 for ; Wed, 7 Feb 2018 21:02:06 -0500 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g0d9u07qe-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 07 Feb 2018 21:02:05 -0500 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Feb 2018 02:02:03 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 8 Feb 2018 02:02:01 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w182201R43843662; Thu, 8 Feb 2018 02:02:00 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7A99AE05F; Thu, 8 Feb 2018 01:53:12 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F714AE059; Thu, 8 Feb 2018 01:53:12 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 8 Feb 2018 01:53:12 +0000 (GMT) Received: from intelligence.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id B7882A0273; Thu, 8 Feb 2018 13:01:58 +1100 (AEDT) From: Andrew Donnellan To: snowpatch@lists.ozlabs.org Date: Thu, 8 Feb 2018 13:01:39 +1100 X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180208020140.20903-1-andrew.donnellan@au1.ibm.com> References: <20180208020140.20903-1-andrew.donnellan@au1.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18020802-0040-0000-0000-0000042D8F5D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020802-0041-0000-0000-000020D143BC Message-Id: <20180208020140.20903-3-andrew.donnellan@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-07_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802080018 X-Mailman-Approved-At: Thu, 08 Feb 2018 13:05:21 +1100 Subject: [snowpatch] [PATCH 3/4] Add warn-on-fail for non-critical tests X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Continuous Integration for patch-based workflows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: snowpatch-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "snowpatch" From: Russell Currey Signed-off-by: Russell Currey [ajd: rebase on serde changes] Signed-off-by: Andrew Donnellan --- src/main.rs | 5 ++++- src/settings.rs | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 82beac6b2ab3..b1b143babdcc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,8 +140,11 @@ fn run_tests(settings: &Config, client: Arc, project: &Project, tag: &st } debug!("Build URL: {}", build_url_real); jenkins.wait_build(&build_url_real); - let test_result = jenkins.get_build_result(&build_url_real).unwrap(); + let mut test_result = jenkins.get_build_result(&build_url_real).unwrap(); info!("Jenkins job for {}/{} complete.", branch_name, job.title); + if test_result == TestState::Fail && job.warn_on_fail { + test_result = TestState::Warning; + } results.push(TestResult { description: Some(format!("Test {} on branch {}", job.title, branch_name.to_string()).to_string()), diff --git a/src/settings.rs b/src/settings.rs index 7e3c87ddd0ac..0ce70313b3dd 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -81,6 +81,7 @@ pub struct Job { pub remote: String, pub branch: String, pub hefty: bool, + pub warn_on_fail: bool, pub parameters: BTreeMap, } @@ -105,6 +106,7 @@ impl<'de> Deserialize<'de> for Job { let mut remote = None; let mut branch = None; let mut hefty = None; + let mut warn_on_fail = None; let mut parameters = BTreeMap::new(); while let Some(key) = map.next_key::()? { match key.as_str() { @@ -138,6 +140,12 @@ impl<'de> Deserialize<'de> for Job { } hefty = Some(map.next_value()?); } + "warn_on_fail" => { + if warn_on_fail.is_some() { + return Err(de::Error::duplicate_field("warn_on_fail")); + } + warn_on_fail = Some(map.next_value()?); + } _ => { parameters.insert(key, map.next_value()?); } @@ -149,6 +157,7 @@ impl<'de> Deserialize<'de> for Job { let branch = branch.ok_or_else(|| de::Error::missing_field("branch"))?; let title = title.unwrap_or(job.clone()); let hefty = hefty.unwrap_or(false); + let warn_on_fail = warn_on_fail.unwrap_or(false); Ok(Job { job: job, @@ -156,6 +165,7 @@ impl<'de> Deserialize<'de> for Job { remote: remote, branch: branch, hefty: hefty, + warn_on_fail: warn_on_fail, parameters: parameters, }) }