Use Env REDIS_URL in test.

This commit is contained in:
Naoki Kosaka 2021-06-18 09:31:01 +09:00
parent 73a1f2231c
commit 99f870e0f2
2 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,8 @@ func TestMain(m *testing.M) {
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
viper.ReadConfig(file) viper.ReadConfig(file)
viper.Set("actor_pem", "../misc/testKey.pem") viper.Set("ACTOR_PEM", "../misc/testKey.pem")
viper.BindEnv("REDIS_URL")
globalConfig, err = models.NewRelayConfig() globalConfig, err = models.NewRelayConfig()
if err != nil { if err != nil {

View File

@ -21,7 +21,8 @@ func TestMain(m *testing.M) {
viper.SetConfigType("yaml") viper.SetConfigType("yaml")
viper.ReadConfig(file) viper.ReadConfig(file)
viper.Set("actor_pem", "../misc/testKey.pem") viper.Set("ACTOR_PEM", "../misc/testKey.pem")
viper.BindEnv("REDIS_URL")
globalConfig, err = NewRelayConfig() globalConfig, err = NewRelayConfig()
if err != nil { if err != nil {