Skip to content
Snippets Groups Projects
Commit 64548873 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6747 resolve comments

parent 0aa1b67d
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,6 @@ buf generate
ACTIVE_PROFILE=local go run cmd/antragsraum-proxy/main.go
```
## Config
config.yml is the default config for deployment
......@@ -71,8 +69,6 @@ logging:
level: "ERROR" | "WARN" | "INFO" | "DEBUG"
```
### Releasing
Diese Schritte ausführen:
......@@ -91,4 +87,3 @@ Diese Schritte ausführen:
* Release-Branch in den Master mergen nicht pushen!
* Die Version von 'var version' in cmd/antragraum-proxy/main.go "vX.X.X" auf "vX.X.X-beta.x" ändern
* Master Branch pushen
......@@ -26,17 +26,17 @@
package config
import (
"fmt"
"gopkg.in/yaml.v3"
"log"
"os"
"testing"
"fmt"
)
const (
defaultConfig = "config.yml"
testFilePath = "testdata/"
activeProfile = "ACTIVE_PROFILE"
activeProfileParam = "ACTIVE_PROFILE"
)
type Config struct {
......@@ -64,7 +64,7 @@ func LoadConfig(configFilePath ...string) Config {
configFile := defaultConfig
env := os.Getenv(activeProfile)
env := os.Getenv(activeProfileParam)
if env != "" {
configFile = fmt.Sprintf("config-%s.yml", env)
}
......
......@@ -26,9 +26,9 @@
package config
import (
"testing"
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func TestLoadConfig(t *testing.T) {
......@@ -46,11 +46,11 @@ func TestLoadConfig(t *testing.T) {
})
t.Run("should load local config", func(t *testing.T) {
assert.NoError(t, os.Setenv(activeProfile, "local"), "Setenv "+activeProfile+" should not return an error")
assert.NoError(t, os.Setenv(activeProfileParam, "local"), "Setenv "+activeProfileParam+" should not return an error")
config := LoadConfig()
assert.NoError(t, os.Unsetenv(activeProfile), "Unsetenv "+activeProfile+" should not return an error")
assert.NoError(t, os.Unsetenv(activeProfileParam), "Unsetenv "+activeProfileParam+" should not return an error")
expectedConfig := Config{}
expectedConfig.Grpc.Server.Mock = true
......@@ -61,5 +61,4 @@ func TestLoadConfig(t *testing.T) {
assert.Equal(t, expectedConfig, config)
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment