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
|
gocov convert coverage.out > coverage.json
|
||||||
|
|
||||||
test-api:
|
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
|
sleep 15 && newman run source/tmpl/postman.json -e dev/postman_environment.json
|
||||||
|
|
||||||
# report coverage to Coveralls
|
# report coverage to Coveralls
|
||||||
|
|
|
@ -55,19 +55,17 @@ func LoadUsingEnv() (*DbConfig, error) {
|
||||||
if os.Getenv("DB_CONN") == "" {
|
if os.Getenv("DB_CONN") == "" {
|
||||||
return nil, errors.New("Missing DB_CONN environment variable")
|
return nil, errors.New("Missing DB_CONN environment variable")
|
||||||
}
|
}
|
||||||
if os.Getenv("DB_CONN") != "sqlite" {
|
if os.Getenv("DB_HOST") == "" {
|
||||||
if os.Getenv("DB_HOST") == "" {
|
return nil, errors.New("Missing DB_HOST environment variable")
|
||||||
return nil, errors.New("Missing DB_HOST environment variable")
|
}
|
||||||
}
|
if os.Getenv("DB_USER") == "" {
|
||||||
if os.Getenv("DB_USER") == "" {
|
return nil, errors.New("Missing DB_USER environment variable")
|
||||||
return nil, errors.New("Missing DB_USER environment variable")
|
}
|
||||||
}
|
if os.Getenv("DB_PASS") == "" {
|
||||||
if os.Getenv("DB_PASS") == "" {
|
return nil, errors.New("Missing DB_PASS environment variable")
|
||||||
return nil, errors.New("Missing DB_PASS environment variable")
|
}
|
||||||
}
|
if os.Getenv("DB_DATABASE") == "" {
|
||||||
if os.Getenv("DB_DATABASE") == "" {
|
return nil, errors.New("Missing DB_DATABASE environment variable")
|
||||||
return nil, errors.New("Missing DB_DATABASE environment variable")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Configs = EnvToConfig()
|
Configs = EnvToConfig()
|
||||||
CoreApp.Name = os.Getenv("NAME")
|
CoreApp.Name = os.Getenv("NAME")
|
||||||
|
|
Loading…
Reference in New Issue