Do not read config from os.Environ when running tests

Fixes #8655
This commit is contained in:
Bjørn Erik Pedersen
2021-06-16 18:58:40 +02:00
parent d392893cd7
commit 31fb29fb3f
3 changed files with 11 additions and 2 deletions

View File

@@ -141,3 +141,13 @@ func GetDependencyList() []string {
return deps
}
// IsRunningAsTest reports whether we are running as a test.
func IsRunningAsTest() bool {
for _, arg := range os.Args {
if strings.HasPrefix(arg, "-test") {
return true
}
}
return false
}