mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Provisioning: Interpolate env vars in provisioning files (#16499)
* Add value types with custom unmarshalling logic * Add env support for notifications config * Use env vars in json data tests for values * Add some more complexities to value tests * Update comment with example usage * Set env directly in the tests, removing patching * Update documentation * Add env var to the file reader tests * Add raw value * Post merge fixes * Add comment
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package notifiers
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/log"
|
||||
@@ -43,8 +44,10 @@ func TestNotificationAsConfig(t *testing.T) {
|
||||
})
|
||||
|
||||
Convey("Can read correct properties", func() {
|
||||
_ = os.Setenv("TEST_VAR", "default")
|
||||
cfgProvifer := &configReader{log: log.New("test logger")}
|
||||
cfg, err := cfgProvifer.readConfig(correct_properties)
|
||||
_ = os.Unsetenv("TEST_VAR")
|
||||
if err != nil {
|
||||
t.Fatalf("readConfig return an error %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user