From dba8f51f2576fbdd877b6c1839176c83ff0be4b3 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Fri, 19 Jul 2024 15:24:39 -0400 Subject: [PATCH] Remove tests --- .../datadogexporter/config_warnings_test.go | 77 ------------------- 1 file changed, 77 deletions(-) diff --git a/exporter/datadogexporter/config_warnings_test.go b/exporter/datadogexporter/config_warnings_test.go index 1a92c0486b4b..3d26e9844689 100644 --- a/exporter/datadogexporter/config_warnings_test.go +++ b/exporter/datadogexporter/config_warnings_test.go @@ -94,80 +94,3 @@ func TestSendAggregations(t *testing.T) { } } - -func TestPeerTags(t *testing.T) { - tests := []struct { - name string - cfgMap *confmap.Conf - expectedPeerTagsValue bool - warnings []string - err string - }{ - { - name: "both traces::peer_service_aggregation and traces::peer_tags_aggregation", - cfgMap: confmap.NewFromStringMap(map[string]any{ - "traces": map[string]any{ - "peer_service_aggregation": true, - "peer_tags_aggregation": true, - }, - }), - err: "\"traces::peer_service_aggregation\" and \"traces::peer_tags_aggregation\" can't be both set at the same time: use \"traces::peer_tags_aggregation\" only instead", - }, - { - name: "traces::peer_service_aggregation set to true", - cfgMap: confmap.NewFromStringMap(map[string]any{ - "traces": map[string]any{ - "peer_service_aggregation": true, - }, - }), - expectedPeerTagsValue: true, - warnings: []string{ - "\"traces::peer_service_aggregation\" has been deprecated in favor of \"traces::peer_tags_aggregation\"", - }, - }, - { - name: "traces::peer_service_aggregation set to false", - cfgMap: confmap.NewFromStringMap(map[string]any{ - "traces": map[string]any{ - "peer_service_aggregation": false, - }, - }), - warnings: []string{ - "\"traces::peer_service_aggregation\" has been deprecated in favor of \"traces::peer_tags_aggregation\"", - }, - }, - { - name: "traces::peer_service_aggregation and traces::peer_tags_aggregation unset", - cfgMap: confmap.New(), - expectedPeerTagsValue: false, - }, - { - name: "traces::peer_tags_aggregation set", - cfgMap: confmap.NewFromStringMap(map[string]any{ - "traces": map[string]any{ - "peer_tags_aggregation": true, - }, - }), - expectedPeerTagsValue: true, - }, - } - - for _, testInstance := range tests { - t.Run(testInstance.name, func(t *testing.T) { - f := NewFactory() - cfg := f.CreateDefaultConfig().(*Config) - err := testInstance.cfgMap.Unmarshal(cfg) - if err != nil || testInstance.err != "" { - assert.ErrorContains(t, err, testInstance.err) - } else { - assert.Equal(t, testInstance.expectedPeerTagsValue, cfg.Traces.PeerTagsAggregation) - var warningStr []string - for _, warning := range cfg.warnings { - warningStr = append(warningStr, warning.Error()) - } - assert.ElementsMatch(t, testInstance.warnings, warningStr) - } - }) - } - -}