1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-19 06:42:36 +08:00
Files
Ho-Sheng Hsiao bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00

53 lines
1.2 KiB
Go

// Package ci implements some helper functions to use during
// tests. Many times certain facilities are not available, or tests
// must run differently.
package ci
import (
"os"
jenkins "github.com/ipfs/go-ipfs/util/testutil/ci/jenkins"
travis "github.com/ipfs/go-ipfs/util/testutil/ci/travis"
)
// EnvVar is a type to use travis-only env var names with
// the type system.
type EnvVar string
// Environment variables that TravisCI uses.
const (
VarCI EnvVar = "TEST_NO_FUSE"
VarNoFuse EnvVar = "TEST_NO_FUSE"
VarVerbose EnvVar = "TEST_VERBOSE"
)
// IsRunning attempts to determine whether this process is
// running on CI. This is done by checking any of:
//
// CI=true
// travis.IsRunning()
// jenkins.IsRunning()
//
func IsRunning() bool {
if os.Getenv(string(VarCI)) == "true" {
return true
}
return travis.IsRunning() || jenkins.IsRunning()
}
// Env returns the value of a CI env variable.
func Env(v EnvVar) string {
return os.Getenv(string(v))
}
// Returns whether FUSE is explicitly disabled wiht TEST_NO_FUSE.
func NoFuse() bool {
return os.Getenv(string(VarNoFuse)) == "1"
}
// Returns whether TEST_VERBOSE is enabled.
func Verbose() bool {
return os.Getenv(string(VarVerbose)) == "1"
}