mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
tests: expect Docker on AppVeyor
Prepare to run docker on AppVeyor Windows environment
This commit is contained in:
@@ -16,6 +16,10 @@ func DockerIsConnected(t *testing.T) bool {
|
||||
return runtime.GOOS == "linux"
|
||||
}
|
||||
|
||||
if testutil.IsAppVeyor() {
|
||||
return runtime.GOOS == "windows"
|
||||
}
|
||||
|
||||
client, err := docker.NewClientFromEnv()
|
||||
if err != nil {
|
||||
return false
|
||||
|
||||
@@ -10,12 +10,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
const (
|
||||
// TravisRunEnv is an environment variable that is set if being run by
|
||||
// Travis.
|
||||
TravisRunEnv = "CI"
|
||||
)
|
||||
|
||||
type testFn func() (bool, error)
|
||||
type errorFn func(error)
|
||||
|
||||
@@ -69,8 +63,18 @@ func Timeout(original time.Duration) time.Duration {
|
||||
return original * time.Duration(TestMultiplier())
|
||||
}
|
||||
|
||||
func IsCI() bool {
|
||||
_, ok := os.LookupEnv("CI")
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsTravis() bool {
|
||||
_, ok := os.LookupEnv(TravisRunEnv)
|
||||
_, ok := os.LookupEnv("TRAVIS")
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsAppVeyor() bool {
|
||||
_, ok := os.LookupEnv("APPVEYOR")
|
||||
return ok
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user