Skip to content

Commit

Permalink
reorders the assert in the sequence call
Browse files Browse the repository at this point in the history
Signed-off-by: Afzal Ansari <afzal442@gmail.com>
  • Loading branch information
afzal442 committed Jul 28, 2023
1 parent 3295970 commit d822929
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugin/metrics/prometheus/metricsstore/reader_test.go
Expand Up @@ -151,11 +151,11 @@ func TestMetricsServerError(t *testing.T) {
}, logger, tracer)
require.NoError(t, err)
m, err := reader.GetCallRates(context.Background(), &params)
assert.NotNil(t, exp.GetSpans()[0].Status)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
assert.NotNil(t, m)
require.Error(t, err)
assert.Contains(t, err.Error(), "failed executing metrics query")
require.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
assert.Equal(t, "service_call_rate", exp.GetSpans()[0].Name)
}

func TestGetLatencies(t *testing.T) {
Expand Down Expand Up @@ -254,9 +254,9 @@ func TestGetLatencies(t *testing.T) {
defer mockPrometheus.Close()

m, err := reader.GetLatencies(context.Background(), &params)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
require.NoError(t, err)
assertMetrics(t, m, tc.wantLabels, tc.wantName, tc.wantDescription)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
})
}
}
Expand Down Expand Up @@ -354,9 +354,9 @@ func TestGetCallRates(t *testing.T) {
defer mockPrometheus.Close()

m, err := reader.GetCallRates(context.Background(), &params)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
require.NoError(t, err)
assertMetrics(t, m, tc.wantLabels, tc.wantName, tc.wantDescription)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
})
}
}
Expand Down Expand Up @@ -479,9 +479,9 @@ func TestGetErrorRates(t *testing.T) {
defer mockPrometheus.Close()

m, err := reader.GetErrorRates(context.Background(), &params)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
require.NoError(t, err)
assertMetrics(t, m, tc.wantLabels, tc.wantName, tc.wantDescription)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
})
}
}
Expand Down Expand Up @@ -512,9 +512,9 @@ func TestWarningResponse(t *testing.T) {
defer mockPrometheus.Close()

m, err := reader.GetErrorRates(context.Background(), &params)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
require.NoError(t, err)
assert.NotNil(t, m)
assert.Len(t, exp.GetSpans(), 1, "HTTP request was traced and span reported")
}

func TestGetRoundTripperTLSConfig(t *testing.T) {
Expand Down

0 comments on commit d822929

Please sign in to comment.