From patchwork Wed Apr 20 08:56:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Donnellan X-Patchwork-Id: 612585 X-Patchwork-Delegate: ruscur@russell.cc Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qqbcs1wyWz9t5T for ; Wed, 20 Apr 2016 19:07:41 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qqbcs1DbrzDqWs for ; Wed, 20 Apr 2016 19:07:41 +1000 (AEST) X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qqbcn65QQzDqK8 for ; Wed, 20 Apr 2016 19:07:37 +1000 (AEST) Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Apr 2016 18:57:32 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 20 Apr 2016 18:57:29 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: andrew.donnellan@au1.ibm.com X-IBM-RcptTo: snowpatch@lists.ozlabs.org Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 3AC932BB005A for ; Wed, 20 Apr 2016 18:57:29 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3K8vKW615728756 for ; Wed, 20 Apr 2016 18:57:29 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u3K8uuXb027014 for ; Wed, 20 Apr 2016 18:56:56 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u3K8uuiv026481 for ; Wed, 20 Apr 2016 18:56:56 +1000 Received: from ajd.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 651DAA01D3 for ; Wed, 20 Apr 2016 18:56:31 +1000 (AEST) From: Andrew Donnellan To: snowpatch@lists.ozlabs.org Date: Wed, 20 Apr 2016 18:56:23 +1000 Message-Id: <1461142583-12049-1-git-send-email-andrew.donnellan@au1.ibm.com> X-Mailer: git-send-email 2.6.2 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16042008-0033-0000-0000-00000599E32B Subject: [snowpatch] [PATCH] Include branch name in test results sent to Patchwork X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.20 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" If a project is configured to test on multiple branches and a patch applies to more than one base branch, only one result for each Jenkins job will appear in Patchwork since the test name is the same. Reformat the Patchwork test names to be of the format "branch/test_name" so we can distinguish between different base branches. Closes: #25 ("Test names sent to Patchwork need to differ per branch") Reported-by: Russell Currey Signed-off-by: Andrew Donnellan --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d0177af..e9c2035 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,7 +79,7 @@ struct Args { flag_project: String, } -fn run_tests(settings: &Config, project: &Project, tag: &str) -> Vec { +fn run_tests(settings: &Config, project: &Project, tag: &str, branch_name: &str) -> Vec { let mut results: Vec = Vec::new(); let jenkins = JenkinsBackend { base_url: &settings.jenkins.url }; let project = project.clone(); @@ -112,7 +112,7 @@ fn run_tests(settings: &Config, project: &Project, tag: &str) -> Vec jenkins.wait_build(&build_url_real); println!("Job done!"); results.push(TestResult { - test_name: job_name.to_string(), + test_name: format!("{}/{}", branch_name.to_string(), job_name.to_string()), state: TestState::SUCCESS.string(), // TODO: get this from Jenkins url: None, // TODO: link to Jenkins job log summary: Some("TODO: get this summary from Jenkins".to_string()), @@ -201,7 +201,7 @@ fn test_patch(settings: &Config, project: &Project, path: &Path) -> Vec