From fb75240fee2f2b04d50572c605c0b59bf86d8d95 Mon Sep 17 00:00:00 2001 From: foghost Date: Mon, 28 Aug 2023 11:11:31 +0800 Subject: [PATCH] fix unit test --- config/metric_config.go | 1 - config/metric_config_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config/metric_config.go b/config/metric_config.go index 52387852df..b0e45d06aa 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -78,7 +78,6 @@ func (mc *MetricConfig) Init(rc *RootConfig) error { return err } mc.rootConfig = rc - metrics.InitAppInfo(GetRootConfig().Application.Name, GetRootConfig().Application.Version) config := mc.ToReporterConfig() extension.GetMetricReporter(mc.Protocol, config) metrics.Init(mc.toURL()) diff --git a/config/metric_config_test.go b/config/metric_config_test.go index 14804b3c7c..70dce11b1e 100644 --- a/config/metric_config_test.go +++ b/config/metric_config_test.go @@ -27,7 +27,7 @@ import ( func TestMetricConfigBuilder(t *testing.T) { config := NewMetricConfigBuilder().Build() - err := config.Init() + err := config.Init(&RootConfig{Application: &ApplicationConfig{Name: "dubbo", Version: "1.0.0"}}) assert.NoError(t, err) reporterConfig := config.ToReporterConfig() assert.Equal(t, string(reporterConfig.Mode), "pull")