1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-27 16:07:42 +08:00

Merge pull request #2114 from ipfs/remove-jenkins

ci: remove dead jenkins code
This commit is contained in:
Jeromy Johnson
2016-01-15 23:55:20 +01:00
5 changed files with 2 additions and 95 deletions

View File

@ -151,7 +151,7 @@ func TestDialWait(t *testing.T) {
func TestDialBackoff(t *testing.T) {
// t.Skip("skipping for another test")
if ci.IsRunning() {
t.Skip("travis and jenkins will never have fun with this test")
t.Skip("travis will never have fun with this test")
}
t.Parallel()

View File

@ -1,13 +0,0 @@
#!/bin/sh
export GOPATH=$WORKSPACE
PWD=`pwd`
cd ../3nodetest
make clean
make test
make save_logs
docker cp 3nodetest_server_1:/root/.ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp 3nodetest_bootstrap_1:/root/.ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp 3nodetest_client_1:/root/.ipfs/logs/events.log $(PWD)/build/client-events.log

View File

@ -6,7 +6,6 @@ package ci
import (
"os"
jenkins "github.com/ipfs/go-ipfs/util/testutil/ci/jenkins"
travis "github.com/ipfs/go-ipfs/util/testutil/ci/travis"
)
@ -26,14 +25,9 @@ const (
//
// CI=true
// travis.IsRunning()
// jenkins.IsRunning()
//
func IsRunning() bool {
if os.Getenv(string(VarCI)) == "true" {
return true
}
return travis.IsRunning() || jenkins.IsRunning()
return os.Getenv(string(VarCI)) == "true" || travis.IsRunning()
}
// Env returns the value of a CI env variable.

View File

@ -1,58 +0,0 @@
// Package jenkins implements some helper functions to use during
// tests. Many times certain facilities are not available, or tests
// must run differently.
package jenkins
import (
"os"
"strings"
)
// EnvVar is a type to use travis-only env var names with
// the type system.
type EnvVar string
// Environment variables that Jenkins uses.
const (
VarBuildNumber EnvVar = "BUILD_NUMBER"
VarBuildId EnvVar = "BUILD_ID"
VarBuildUrl EnvVar = "BUILD_URL"
VarNodeName EnvVar = "NODE_NAME"
VarJobName EnvVar = "JOB_NAME"
VarBuildTag EnvVar = "BUILD_TAG"
VarJenkinsUrl EnvVar = "JENKINS_URL"
VarExecutorNumber EnvVar = "EXECUTOR_NUMBER"
VarJavaHome EnvVar = "JAVA_HOME"
VarWorkspace EnvVar = "WORKSPACE"
VarSvnRevision EnvVar = "SVN_REVISION"
VarCvsBranch EnvVar = "CVS_BRANCH"
VarGitCommit EnvVar = "GIT_COMMIT"
VarGitUrl EnvVar = "GIT_URL"
VarGitBranch EnvVar = "GIT_BRANCH"
)
// IsRunning attempts to determine whether this process is
// running on Jenkins CI. This is done by checking any of the
// following:
//
// JENKINS_URL is set
// BuildTag has prefix "jenkins-"
//
func IsRunning() bool {
return len(Env(VarJenkinsUrl)) > 0 || strings.HasPrefix(Env(VarBuildTag), "jenkins-")
}
// Env returns the value of a travis env variable.
func Env(v EnvVar) string {
return os.Getenv(string(v))
}
// JobName returns the jenkins JOB_NAME of this build.
func JobName() string {
return Env(VarJobName)
}
// BuildTag returns the jenkins BUILD_TAG.
func BuildTag() string {
return Env(VarBuildTag)
}

View File

@ -1,16 +0,0 @@
package jenkins
import (
"os"
"strings"
"testing"
)
func TestIsRunning(t *testing.T) {
hasPrefix := strings.HasPrefix(os.Getenv("BUILD_TAG"), "jenkins-")
tr := len(os.Getenv("JENKINS_URL")) > 0 || hasPrefix
if tr != IsRunning() {
t.Error("IsRunning() does not match TRAVIS && CI env var check")
}
}