jenkins_test.go 311 Bytes
Newer Older
Jeromy's avatar
Jeromy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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")
	}
}