server: handle command line and env variables at one place. (#3975)

This commit is contained in:
Bala FA
2017-03-30 23:51:19 +05:30
committed by Harshavardhana
parent 447fdd4097
commit 2df8160f6a
14 changed files with 169 additions and 298 deletions
+4 -2
View File
@@ -122,7 +122,7 @@ func TestServerConfig(t *testing.T) {
setConfigDir(rootPath)
// Initialize server config.
if err := loadConfig(envParams{}); err != nil {
if err := loadConfig(); err != nil {
t.Fatalf("Unable to initialize from updated config file %s", err)
}
}
@@ -149,6 +149,8 @@ func TestServerConfigWithEnvs(t *testing.T) {
t.Error(err)
}
serverHandleEnvVars()
// Do this only once here.
setConfigDir(rootPath)
@@ -160,7 +162,7 @@ func TestServerConfigWithEnvs(t *testing.T) {
// Check if serverConfig has
if serverConfig.GetBrowser() {
t.Errorf("Expecting browser `off` found %s", serverConfig.GetBrowser())
t.Errorf("Expecting browser is set to false found %v", serverConfig.GetBrowser())
}
// Check if serverConfig has