mirror of https://github.com/statping/statping
tests
parent
5fe7685f37
commit
8f04ebee7f
2
Makefile
2
Makefile
|
@ -86,7 +86,7 @@ test: clean compile install build-plugin
|
|||
gocov convert coverage.out > coverage.json
|
||||
|
||||
test-api:
|
||||
DB_CONN=sqlite statup &
|
||||
DB_CONN=sqlite DB_HOST=localhost DB_DATABASE=sqlite DB_PASS=none DB_USER=none statup &
|
||||
sleep 15 && newman run source/tmpl/postman.json -e dev/postman_environment.json
|
||||
|
||||
# report coverage to Coveralls
|
||||
|
|
|
@ -55,19 +55,17 @@ func LoadUsingEnv() (*DbConfig, error) {
|
|||
if os.Getenv("DB_CONN") == "" {
|
||||
return nil, errors.New("Missing DB_CONN environment variable")
|
||||
}
|
||||
if os.Getenv("DB_CONN") != "sqlite" {
|
||||
if os.Getenv("DB_HOST") == "" {
|
||||
return nil, errors.New("Missing DB_HOST environment variable")
|
||||
}
|
||||
if os.Getenv("DB_USER") == "" {
|
||||
return nil, errors.New("Missing DB_USER environment variable")
|
||||
}
|
||||
if os.Getenv("DB_PASS") == "" {
|
||||
return nil, errors.New("Missing DB_PASS environment variable")
|
||||
}
|
||||
if os.Getenv("DB_DATABASE") == "" {
|
||||
return nil, errors.New("Missing DB_DATABASE environment variable")
|
||||
}
|
||||
if os.Getenv("DB_HOST") == "" {
|
||||
return nil, errors.New("Missing DB_HOST environment variable")
|
||||
}
|
||||
if os.Getenv("DB_USER") == "" {
|
||||
return nil, errors.New("Missing DB_USER environment variable")
|
||||
}
|
||||
if os.Getenv("DB_PASS") == "" {
|
||||
return nil, errors.New("Missing DB_PASS environment variable")
|
||||
}
|
||||
if os.Getenv("DB_DATABASE") == "" {
|
||||
return nil, errors.New("Missing DB_DATABASE environment variable")
|
||||
}
|
||||
Configs = EnvToConfig()
|
||||
CoreApp.Name = os.Getenv("NAME")
|
||||
|
|
Loading…
Reference in New Issue