testrig: override bind address from environment variable (#577)

This commit is contained in:
f0x52 2022-05-16 15:05:44 +02:00 committed by GitHub
parent b915a41811
commit 27a3c1dc56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,10 @@ func NewTestRouter(db db.DB) router.Router {
viper.Set(config.Keys.WebTemplateBaseDir, alternativeTemplateBaseDir)
}
if alternativeBindAddress := os.Getenv("GTS_BIND_ADDRESS"); alternativeBindAddress != "" {
viper.Set(config.Keys.BindAddress, alternativeBindAddress)
}
r, err := router.New(context.Background(), db)
if err != nil {
panic(err)