Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jinja2 committed Feb 14, 2024
1 parent 694702d commit 0f906ae
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions pkg/translator/signalfx/from_metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func Test_FromMetrics(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
from := &FromTranslator{}
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), false, false)
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), false, true)
require.NoError(t, err)
// Sort SFx dimensions since they are built from maps and the order
// of those is not deterministic.
Expand Down Expand Up @@ -473,7 +473,7 @@ func Test_FromMetrics(t *testing.T) {
for _, tt := range testsWithDropHistogramBuckets {
t.Run(tt.name, func(t *testing.T) {
from := &FromTranslator{}
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), true, false)
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), true, true)
require.NoError(t, err)
// Sort SFx dimensions since they are built from maps and the order
// of those is not deterministic.
Expand All @@ -493,19 +493,13 @@ func Test_FromMetrics(t *testing.T) {
metricsFn: func() pmetric.Metrics {
out := pmetric.NewMetrics()
ilm := out.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty()

{
m := ilm.Metrics().AppendEmpty()
m.SetName("histogram")
m.SetEmptyHistogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
initHistDP(m.Histogram().DataPoints().AppendEmpty())
}

{
m := ilm.Metrics().AppendEmpty()
m.SetName("gauge_double_with_dims")
initDoublePt(m.SetEmptyGauge().DataPoints().AppendEmpty())
}
m1 := ilm.Metrics().AppendEmpty()
m1.SetName("histogram")
m1.SetEmptyHistogram().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
initHistDP(m1.Histogram().DataPoints().AppendEmpty())
m2 := ilm.Metrics().AppendEmpty()
m2.SetName("gauge_double_with_dims")
initDoublePt(m2.SetEmptyGauge().DataPoints().AppendEmpty())
return out
},
wantSfxDataPoints: []*sfxpb.DataPoint{
Expand All @@ -516,7 +510,7 @@ func Test_FromMetrics(t *testing.T) {
for _, tt := range testsWithIgnoreHistograms {
t.Run(tt.name, func(t *testing.T) {
from := &FromTranslator{}
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), true, true)
gotSfxDataPoints, err := from.FromMetrics(tt.metricsFn(), true, false)
require.NoError(t, err)
// Sort SFx dimensions since they are built from maps and the order
// of those is not deterministic.
Expand Down

0 comments on commit 0f906ae

Please sign in to comment.