mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting/annotations): fixed broken test
This commit is contained in:
parent
b8081b29fd
commit
23de094a81
@ -10,6 +10,8 @@ import (
|
|||||||
|
|
||||||
func TestGraphitePublisher(t *testing.T) {
|
func TestGraphitePublisher(t *testing.T) {
|
||||||
|
|
||||||
|
setting.CustomInitPath = "conf/does_not_exist.ini"
|
||||||
|
|
||||||
Convey("Test graphite prefix replacement", t, func() {
|
Convey("Test graphite prefix replacement", t, func() {
|
||||||
var err error
|
var err error
|
||||||
err = setting.NewConfigContext(&setting.CommandLineArgs{
|
err = setting.NewConfigContext(&setting.CommandLineArgs{
|
||||||
@ -67,7 +69,6 @@ func TestGraphitePublisher(t *testing.T) {
|
|||||||
|
|
||||||
_, err = setting.Cfg.NewSection("metrics.graphite")
|
_, err = setting.Cfg.NewSection("metrics.graphite")
|
||||||
|
|
||||||
setting.InstanceName = "hostname.with.dots.com"
|
|
||||||
publisher, err := CreateGraphitePublisher()
|
publisher, err := CreateGraphitePublisher()
|
||||||
|
|
||||||
So(err, ShouldBeNil)
|
So(err, ShouldBeNil)
|
||||||
|
@ -47,10 +47,11 @@ var (
|
|||||||
BuildStamp int64
|
BuildStamp int64
|
||||||
|
|
||||||
// Paths
|
// Paths
|
||||||
LogsPath string
|
LogsPath string
|
||||||
HomePath string
|
HomePath string
|
||||||
DataPath string
|
DataPath string
|
||||||
PluginsPath string
|
PluginsPath string
|
||||||
|
CustomInitPath = "conf/custom.ini"
|
||||||
|
|
||||||
// Log settings.
|
// Log settings.
|
||||||
LogModes []string
|
LogModes []string
|
||||||
@ -312,7 +313,7 @@ func evalConfigValues() {
|
|||||||
|
|
||||||
func loadSpecifedConfigFile(configFile string) error {
|
func loadSpecifedConfigFile(configFile string) error {
|
||||||
if configFile == "" {
|
if configFile == "" {
|
||||||
configFile = filepath.Join(HomePath, "conf/custom.ini")
|
configFile = filepath.Join(HomePath, CustomInitPath)
|
||||||
// return without error if custom file does not exist
|
// return without error if custom file does not exist
|
||||||
if !pathExists(configFile) {
|
if !pathExists(configFile) {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user