From a7ff13d27b12c657eeb29e168a4df997d3d02798 Mon Sep 17 00:00:00 2001 From: Jaganathan P Date: Tue, 10 Dec 2024 11:34:58 +0530 Subject: [PATCH] modify UT for collector_fields test --- pkg/configprovider/globprovider/provider_test.go | 8 ++++++++ .../globprovider/testdata/mergefunc/a_srcconf.yaml | 2 ++ .../globprovider/testdata/mergefunc/mergeconf.yaml | 2 ++ pkg/configprovider/opampprovider/provider_test.go | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/configprovider/globprovider/provider_test.go b/pkg/configprovider/globprovider/provider_test.go index 856bae43ca..67b375e188 100644 --- a/pkg/configprovider/globprovider/provider_test.go +++ b/pkg/configprovider/globprovider/provider_test.go @@ -176,6 +176,10 @@ func TestRemotelyManagedMergeFlow(t *testing.T) { "collector_fields": map[string]interface{}{ "zone": "eu", }, + "collector_fields1": map[string]interface{}{ + "cluster": "cluster-1", + "zone": "eu", + }, }, }, "processor": "someprocessor", @@ -198,6 +202,10 @@ func TestLocallyManagedMergeFlow(t *testing.T) { "cluster": "cluster-1", "zone": "eu", }, + "collector_fields1": map[string]interface{}{ + "cluster": "cluster-1", + "zone": "eu", + }, }, }, "processor": "someprocessor", diff --git a/pkg/configprovider/globprovider/testdata/mergefunc/a_srcconf.yaml b/pkg/configprovider/globprovider/testdata/mergefunc/a_srcconf.yaml index 7dfde953dd..cb5227cb30 100644 --- a/pkg/configprovider/globprovider/testdata/mergefunc/a_srcconf.yaml +++ b/pkg/configprovider/globprovider/testdata/mergefunc/a_srcconf.yaml @@ -3,4 +3,6 @@ extensions: childKey: "value" collector_fields: cluster: "cluster-1" + collector_fields1: + cluster: "cluster-1" processor: "someprocessor" diff --git a/pkg/configprovider/globprovider/testdata/mergefunc/mergeconf.yaml b/pkg/configprovider/globprovider/testdata/mergefunc/mergeconf.yaml index b3bf9651c4..d6bd8c5065 100644 --- a/pkg/configprovider/globprovider/testdata/mergefunc/mergeconf.yaml +++ b/pkg/configprovider/globprovider/testdata/mergefunc/mergeconf.yaml @@ -3,3 +3,5 @@ extensions: childKey: "value" collector_fields: zone: "eu" + collector_fields1: + zone: "eu" \ No newline at end of file diff --git a/pkg/configprovider/opampprovider/provider_test.go b/pkg/configprovider/opampprovider/provider_test.go index 67dbf18646..de275f9d7f 100644 --- a/pkg/configprovider/opampprovider/provider_test.go +++ b/pkg/configprovider/opampprovider/provider_test.go @@ -144,7 +144,9 @@ func TestRemotelyManagedFlowDisabled(t *testing.T) { exp := confmap.NewFromStringMap(map[string]any{ "extensions::sumologic::childKey": "value", "extensions::sumologic::collector_fields::cluster": "cluster-1", - "extensions::sumologic::collector_fields::zone": "eu", + "extensions::sumologic::collector_fields::zone": "eu", + "extensions::sumologic::collector_fields1::cluster": "cluster-1", + "extensions::sumologic::collector_fields1::zone": "eu", "processor": "someprocessor", "extensions::opamp::remote_configuration_directory": "../globprovider/testdata/mergefunc", "extensions::opamp::endpoint": "wss://example.com/v1/opamp", @@ -179,6 +181,8 @@ func TestRemotelyManagedFlowEnabled(t *testing.T) { exp := confmap.NewFromStringMap(map[string]any{ "extensions::sumologic::childKey": "value", "extensions::sumologic::collector_fields::zone": "eu", + "extensions::sumologic::collector_fields1::cluster": "cluster-1", + "extensions::sumologic::collector_fields1::zone": "eu", "processor": "someprocessor", "extensions::opamp::remote_configuration_directory": "../globprovider/testdata/mergefunc", "extensions::opamp::endpoint": "wss://example.com/v1/opamp",