From patchwork Thu Jul 12 09:49:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Currey X-Patchwork-Id: 942878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41RBCk5th3z9s1R for ; Thu, 12 Jul 2018 19:56:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="lrdtvXSS"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41RBCk2WfkzF35R for ; Thu, 12 Jul 2018 19:56:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="lrdtvXSS"; dkim-atps=neutral X-Original-To: snowpatch@lists.ozlabs.org Delivered-To: snowpatch@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=russell.cc (client-ip=64.147.123.20; helo=wout4-smtp.messagingengine.com; envelope-from=ruscur@russell.cc; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=russell.cc Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="lrdtvXSS"; dkim-atps=neutral X-Greylist: delayed 357 seconds by postgrey-1.36 at bilbo; Thu, 12 Jul 2018 19:56:09 AEST Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41RBCY2kK4zDr0d for ; Thu, 12 Jul 2018 19:56:09 +1000 (AEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 486222FF; Thu, 12 Jul 2018 05:50:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 12 Jul 2018 05:50:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=YBFgsilrnSG9Xfc87 6Lh7QWZfu3ekaur9htzrzQ8GSM=; b=lrdtvXSSf80tcJ+Z/wtpBypuurvuXfXWp Ti7CRFMVMtKxsOaMKsbUD2gwLO7UWbEm+y98W/aAZ309pbLQ60NzPtThcTTblzC9 bU2Q6oQSlc+8zE9FBdA7WOX8mnviKmI2XR2NO/fP41sDcY3mEIWPxnV0NAvFVimh fMy3G0anVoVqZzylBQyGOOnFHqnsoBmIKOcRgbmWCBQy7oBUK9o9hO+G1/etmX67 5CNz1JakrmjmbiWgO5XD3/an+KDu12TyT0cuZdKABcvUVV/akmcWRHIdRyq+xBmt pvYmTsTwjPAW3/OqWV0flzJbR2+UXZcu+bBF8dSf5edE27/3c9ryA== X-ME-Proxy: X-ME-Sender: Received: from snap.au.ibm.com (unknown [122.99.82.10]) by mail.messagingengine.com (Postfix) with ESMTPA id 57E791028B; Thu, 12 Jul 2018 05:50:04 -0400 (EDT) From: Russell Currey To: snowpatch@lists.ozlabs.org Date: Thu, 12 Jul 2018 19:49:42 +1000 Message-Id: <20180712094945.8368-1-ruscur@russell.cc> X-Mailer: git-send-email 2.17.1 Subject: [snowpatch] [PATCH 1/4] Remove jenkins_test and explicit [[bin]] section X-BeenThere: snowpatch@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Continuous Integration for patch-based workflows List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell Currey MIME-Version: 1.0 Errors-To: snowpatch-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "snowpatch" With the rust updates, either we need to remove the [[bin]] section in Cargo.toml to allow auto-inferred binaries, or manually specify where jenkins_test is. While we could do that, I think it has bitrot, it has hardcoded stuff in it and isn't really necessary when we can test Jenkins stuff pretty easily through snowpatch itself now. So, just get rid of it. Signed-off-by: Russell Currey --- Cargo.toml | 3 -- src/bin/jenkins_test.rs | 65 ----------------------------------------- 2 files changed, 68 deletions(-) delete mode 100644 src/bin/jenkins_test.rs diff --git a/Cargo.toml b/Cargo.toml index 8f1e03e..9059764 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,9 +28,6 @@ license = "GPL-2.0+" keywords = ["CI", "continuous integration", "patch", "patchwork", "jenkins", "git"] -[[bin]] -name = "snowpatch" - [dependencies] hyper = "0.10" hyper-openssl = "0.2" diff --git a/src/bin/jenkins_test.rs b/src/bin/jenkins_test.rs deleted file mode 100644 index 21d6f96..0000000 --- a/src/bin/jenkins_test.rs +++ /dev/null @@ -1,65 +0,0 @@ -// -// snowpatch - continuous integration for patch-based workflows -// -// Copyright (C) 2016 IBM Corporation -// Author: Andrew Donnellan -// -// This program is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License as published by the Free -// Software Foundation; either version 2 of the License, or (at your option) -// any later version. -// -// bin/jenkins_test.rs - test program for Jenkins REST API -// - -extern crate hyper; -extern crate url; -extern crate rustc_serialize; - -extern crate snowpatch; - -use std::thread::sleep; -use std::time::Duration; - -use snowpatch::jenkins::{JenkinsBackend, CIBackend, JenkinsBuildStatus}; - -fn main() { - let jenkins = JenkinsBackend { base_url: "https://jenkins.ozlabs.ibm.com" }; - let res = jenkins.start_test("linux-build-manual", vec![("USER_EMAIL", "ajd")]); - let mut build_queue_location = String::new(); - - match res { - Ok(loc) => { - println!("Location: {}", loc); - build_queue_location = loc; - } - - Err(e) => { - println!("{:?}", e); - return; - } - } - - let build_url; - println!("Polling until we have a build executable location..."); - loop { - sleep(Duration::new(1,0)); - let build_url_res = jenkins.get_build_url(&build_queue_location); - println!("Build URL: {:?}", build_url_res); - match build_url_res { - Some(url) => { build_url = url; break; }, - None => {}, - } - } - - println!("Polling until job completion..."); - loop { - sleep(Duration::new(1,0)); - let build_status = jenkins.get_build_status(&build_url); - match build_status { - JenkinsBuildStatus::Running => {}, - JenkinsBuildStatus::Done => {println!("DONE!"); break}, - } - - } -}