Skip to content

Commit fba62b8

Browse files
committed
fix lint
1 parent 587553f commit fba62b8

File tree

2 files changed

+10
-45
lines changed

2 files changed

+10
-45
lines changed

framework/leak/detector_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import (
77

88
f "github.com/smartcontractkit/chainlink-testing-framework/framework"
99

10-
"github.com/smartcontractkit/chainlink-testing-framework/framework/leak"
1110
"github.com/stretchr/testify/require"
11+
12+
"github.com/smartcontractkit/chainlink-testing-framework/framework/leak"
1213
)
1314

1415
func mustTime(start string) time.Time {

framework/prometheus_test.go

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -363,17 +363,8 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
363363
{
364364
name: "single metric with multiple labels",
365365
input: &PrometheusQueryResponse{
366-
Data: struct {
367-
ResultType string `json:"resultType"`
368-
Result []struct {
369-
Metric map[string]string `json:"metric"`
370-
Value []interface{} `json:"value"`
371-
} `json:"result"`
372-
}{
373-
Result: []struct {
374-
Metric map[string]string `json:"metric"`
375-
Value []interface{} `json:"value"`
376-
}{
366+
Data: &PromQueryResponseData{
367+
Result: []PromQueryResponseResult{
377368
{
378369
Metric: map[string]string{
379370
"__name__": "http_requests_total",
@@ -394,17 +385,8 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
394385
{
395386
name: "multiple metrics with shared labels",
396387
input: &PrometheusQueryResponse{
397-
Data: struct {
398-
ResultType string `json:"resultType"`
399-
Result []struct {
400-
Metric map[string]string `json:"metric"`
401-
Value []interface{} `json:"value"`
402-
} `json:"result"`
403-
}{
404-
Result: []struct {
405-
Metric map[string]string `json:"metric"`
406-
Value []interface{} `json:"value"`
407-
}{
388+
Data: &PromQueryResponseData{
389+
Result: []PromQueryResponseResult{
408390
{
409391
Metric: map[string]string{
410392
"__name__": "http_requests_total",
@@ -434,35 +416,17 @@ func TestPrometheusQueryClient_ResultToLabelsMap(t *testing.T) {
434416
{
435417
name: "empty result",
436418
input: &PrometheusQueryResponse{
437-
Data: struct {
438-
ResultType string `json:"resultType"`
439-
Result []struct {
440-
Metric map[string]string `json:"metric"`
441-
Value []interface{} `json:"value"`
442-
} `json:"result"`
443-
}{
444-
Result: []struct {
445-
Metric map[string]string `json:"metric"`
446-
Value []interface{} `json:"value"`
447-
}{},
419+
Data: &PromQueryResponseData{
420+
Result: nil,
448421
},
449422
},
450423
expected: map[string][]interface{}{},
451424
},
452425
{
453426
name: "metric with no labels",
454427
input: &PrometheusQueryResponse{
455-
Data: struct {
456-
ResultType string `json:"resultType"`
457-
Result []struct {
458-
Metric map[string]string `json:"metric"`
459-
Value []interface{} `json:"value"`
460-
} `json:"result"`
461-
}{
462-
Result: []struct {
463-
Metric map[string]string `json:"metric"`
464-
Value []interface{} `json:"value"`
465-
}{
428+
Data: &PromQueryResponseData{
429+
Result: []PromQueryResponseResult{
466430
{
467431
Metric: map[string]string{},
468432
Value: []interface{}{float64(1435781451.781), "1"},

0 commit comments

Comments
 (0)