Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Oct 30, 2024
1 parent 910f754 commit eea7517
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
11 changes: 1 addition & 10 deletions test/new-e2e/tests/otel/otel-agent/no_dd_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,5 @@ func (s *noDDExporterTestSuite) TestOTelAgentInstalled() {
}

func (s *noDDExporterTestSuite) TestFlare() {
expectedContents := []string{
"otel-agent",
"ddflare/dd-autoconfigured:",
"health_check/dd-autoconfigured:",
"pprof/dd-autoconfigured:",
"zpages/dd-autoconfigured:",
"infraattributes/dd-autoconfigured:",
"prometheus/dd-autoconfigured:",
}
utils.TestOTelFlare(s, expectedContents)
utils.TestOTelFlare(s, "", "", "")
}
16 changes: 9 additions & 7 deletions test/new-e2e/tests/otel/utils/config_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,15 @@ func validateConfigs(t *testing.T, expectedCfg string, actualCfg string) {
// Traces, metrics and logs endpoints are set dynamically to the fake intake address in the config
// These endpoints vary from test to test and should be ignored in the comparison
exps, _ := actualConfRaw["exporters"].(map[string]any)
ddExp, _ := exps["datadog"].(map[string]any)
tcfg := ddExp["traces"].(map[string]any)
delete(tcfg, "endpoint")
mcfg := ddExp["metrics"].(map[string]any)
delete(mcfg, "endpoint")
lcfg := ddExp["logs"].(map[string]any)
delete(lcfg, "endpoint")
if ddExp, ok := exps["datadog"]; ok {
ddExpCfg := ddExp.(map[string]any)
tcfg := ddExpCfg["traces"].(map[string]any)
delete(tcfg, "endpoint")
mcfg := ddExpCfg["metrics"].(map[string]any)
delete(mcfg, "endpoint")
lcfg := ddExpCfg["logs"].(map[string]any)
delete(lcfg, "endpoint")
}

actualCfgBytes, err := yaml.Marshal(actualConfRaw)
require.NoError(t, err)
Expand Down

0 comments on commit eea7517

Please sign in to comment.