[1/4] Remove jenkins_test and explicit [[bin]] section

Message ID 20180712094945.8368-1-ruscur@russell.cc
State Accepted
Headers show
Series
  • [1/4] Remove jenkins_test and explicit [[bin]] section
Related show

Commit Message

Russell Currey July 12, 2018, 9:49 a.m.
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 <ruscur@russell.cc>
---
 Cargo.toml              |  3 --
 src/bin/jenkins_test.rs | 65 -----------------------------------------
 2 files changed, 68 deletions(-)
 delete mode 100644 src/bin/jenkins_test.rs

Comments

Andrew Donnellan July 13, 2018, 1:31 a.m. | #1
On 12/07/18 19:49, Russell Currey wrote:
> 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 <ruscur@russell.cc>

Series applied to master: 7e68c7282b78b7268750b92043964c41865b8ed0

Patch

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 <andrew.donnellan@au1.ibm.com>
-//
-// 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},
-        }
-
-    }
-}