Skip to content

Commit

Permalink
Remove tests
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Jul 19, 2024
1 parent 7cfdbd2 commit dba8f51
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions exporter/datadogexporter/config_warnings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}

}

0 comments on commit dba8f51

Please sign in to comment.