|
|
@ -19,6 +19,7 @@ import (
|
|
|
|
"net/http/httptest"
|
|
|
|
"net/http/httptest"
|
|
|
|
"net/url"
|
|
|
|
"net/url"
|
|
|
|
"reflect"
|
|
|
|
"reflect"
|
|
|
|
|
|
|
|
"sort"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
"sync"
|
|
|
|
"sync"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
@ -469,6 +470,8 @@ func TestTargetScraperScrapeOK(t *testing.T) {
|
|
|
|
Value: 2,
|
|
|
|
Value: 2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sort.Sort(expectedSamples)
|
|
|
|
|
|
|
|
sort.Sort(samples)
|
|
|
|
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(samples, expectedSamples) {
|
|
|
|
if !reflect.DeepEqual(samples, expectedSamples) {
|
|
|
|
t.Errorf("Scraped samples did not match served metrics")
|
|
|
|
t.Errorf("Scraped samples did not match served metrics")
|
|
|
|