Skip to content

Commit 3616788

Browse files
committed
delete legacy tests
1 parent 6336910 commit 3616788

File tree

2 files changed

+3
-57
lines changed

2 files changed

+3
-57
lines changed

exporter/datadogexporter/integrationtest/integration_test.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -556,48 +556,6 @@ func sendLogs(t *testing.T, numLogs int, endpoint string) {
556556
assert.NoError(t, logExporter.Export(ctx, lr))
557557
}
558558

559-
func TestIntegrationHostMetrics_WithRemapping_LegacyMetricClient(t *testing.T) {
560-
prevVal := pkgdatadog.MetricRemappingDisabledFeatureGate.IsEnabled()
561-
require.NoError(t, featuregate.GlobalRegistry().Set(pkgdatadog.MetricRemappingDisabledFeatureGate.ID(), false))
562-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", false))
563-
defer func() {
564-
require.NoError(t, featuregate.GlobalRegistry().Set(pkgdatadog.MetricRemappingDisabledFeatureGate.ID(), prevVal))
565-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", true))
566-
}()
567-
568-
expectedMetrics := map[string]struct{}{
569-
// DD conventions
570-
"system.load.15": {},
571-
"system.load.5": {},
572-
"system.mem.total": {},
573-
"system.mem.usable": {},
574-
575-
// OTel conventions with otel. prefix
576-
"otel.system.cpu.load_average.15m": {},
577-
"otel.system.cpu.load_average.5m": {},
578-
"otel.system.memory.usage": {},
579-
}
580-
testIntegrationHostMetrics(t, expectedMetrics, false)
581-
}
582-
583-
func TestIntegrationHostMetrics_WithoutRemapping_LegacyMetricClient(t *testing.T) {
584-
prevVal := pkgdatadog.MetricRemappingDisabledFeatureGate.IsEnabled()
585-
require.NoError(t, featuregate.GlobalRegistry().Set(pkgdatadog.MetricRemappingDisabledFeatureGate.ID(), true))
586-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", false))
587-
defer func() {
588-
require.NoError(t, featuregate.GlobalRegistry().Set(pkgdatadog.MetricRemappingDisabledFeatureGate.ID(), prevVal))
589-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", true))
590-
}()
591-
592-
expectedMetrics := map[string]struct{}{
593-
// OTel conventions
594-
"system.cpu.load_average.15m": {},
595-
"system.cpu.load_average.5m": {},
596-
"system.memory.usage": {},
597-
}
598-
testIntegrationHostMetrics(t, expectedMetrics, false)
599-
}
600-
601559
func TestIntegrationHostMetrics_WithRemapping_Serializer(t *testing.T) {
602560
prevVal := pkgdatadog.MetricRemappingDisabledFeatureGate.IsEnabled()
603561
require.NoError(t, featuregate.GlobalRegistry().Set(pkgdatadog.MetricRemappingDisabledFeatureGate.ID(), false))

exporter/datadogexporter/integrationtest/no_race_integration_test.go

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ package integrationtest // import "github.com/open-telemetry/opentelemetry-colle
77

88
import (
99
"context"
10-
"encoding/json"
1110
"fmt"
1211
"runtime"
1312
"strconv"
@@ -17,16 +16,11 @@ import (
1716
"github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil"
1817
"github.com/stretchr/testify/assert"
1918
"github.com/stretchr/testify/require"
20-
"go.opentelemetry.io/collector/featuregate"
2119

2220
commonTestutil "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil"
2321
)
2422

2523
func TestIntegrationInternalMetrics(t *testing.T) {
26-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", false))
27-
defer func() {
28-
require.NoError(t, featuregate.GlobalRegistry().Set("exporter.datadogexporter.metricexportserializerclient", true))
29-
}()
3024
expectedMetrics := map[string]struct{}{
3125
// Datadog internal metrics on trace and stats writers
3226
"datadog.otlp_translator.resources.missing_source": {},
@@ -95,20 +89,14 @@ func testIntegrationInternalMetrics(t *testing.T, expectedMetrics map[string]str
9589

9690
// 4. Validate Datadog trace agent & OTel internal metrics are sent to the mock server
9791
metricMap := make(map[string]series)
92+
var err error
9893
for len(metricMap) < len(expectedMetrics) {
9994
select {
10095
case <-tracesRec.ReqChan:
10196
// Drain the channel, no need to look into the traces
10297
case metricsBytes := <-seriesRec.ReqChan:
103-
var metrics seriesSlice
104-
gz := getGzipReader(t, metricsBytes)
105-
dec := json.NewDecoder(gz)
106-
assert.NoError(t, dec.Decode(&metrics))
107-
for _, s := range metrics.Series {
108-
if _, ok := expectedMetrics[s.Metric]; ok {
109-
metricMap[s.Metric] = s
110-
}
111-
}
98+
metricMap, err = seriesFromSerializer(metricsBytes, expectedMetrics)
99+
require.NoError(t, err)
112100
case <-time.After(60 * time.Second):
113101
t.Fail()
114102
}

0 commit comments

Comments
 (0)