From 2e36abe8fd033a27e7a2ca1f2c2918453089fa91 Mon Sep 17 00:00:00 2001 From: FlamingSaint Date: Mon, 22 Jul 2024 23:58:54 +0530 Subject: [PATCH] fix Signed-off-by: FlamingSaint --- plugin/metrics/prometheus/factory_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugin/metrics/prometheus/factory_test.go b/plugin/metrics/prometheus/factory_test.go index bd49eca32d5..cc677fb7f61 100644 --- a/plugin/metrics/prometheus/factory_test.go +++ b/plugin/metrics/prometheus/factory_test.go @@ -24,6 +24,7 @@ import ( "go.uber.org/zap" "github.com/jaegertracing/jaeger/pkg/config" + promCfg "github.com/jaegertracing/jaeger/pkg/prometheus/config" "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/storage" ) @@ -134,6 +135,20 @@ func TestFailedTLSOptions(t *testing.T) { t.Errorf("f.InitFromViper did not panic") } +func TestEmptyFactoryConfig(t *testing.T) { + cfg := promCfg.Configuration{} + _, err := NewFactoryWithConfig(cfg, zap.NewNop()) + require.Error(t, err) +} + +func TestFactoryConfig(t *testing.T) { + cfg := promCfg.Configuration{ + ServerURL: "localhost:1234", + } + _, err := NewFactoryWithConfig(cfg, zap.NewNop()) + require.NoError(t, err) +} + func TestMain(m *testing.M) { testutils.VerifyGoLeaks(m) }