mirror of https://github.com/prometheus/prometheus
storage: Make tests go-vet and golint clean
parent
485ac8dff7
commit
4719482f5f
|
@ -39,7 +39,10 @@ func TestLen(t *testing.T) {
|
|||
t.Errorf("chunk type %s should have %d samples, had %d", c.Encoding(), i, c.Len())
|
||||
}
|
||||
|
||||
cs, _ := c.Add(model.SamplePair{model.Time(i), model.SampleValue(i)})
|
||||
cs, _ := c.Add(model.SamplePair{
|
||||
Timestamp: model.Time(i),
|
||||
Value: model.SampleValue(i),
|
||||
})
|
||||
c = cs[0]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,9 @@ func (s *NoopStorage) Querier() (Querier, error) {
|
|||
return &NoopQuerier{}, nil
|
||||
}
|
||||
|
||||
// NoopQuerier is a dummy Querier for use when Prometheus's local storage is
|
||||
// disabled. It is returned by the NoopStorage Querier method and always returns
|
||||
// empty results.
|
||||
type NoopQuerier struct{}
|
||||
|
||||
// Close implements Querier.
|
||||
|
|
|
@ -319,31 +319,31 @@ func TestFingerprintsForLabels(t *testing.T) {
|
|||
expected model.Fingerprints
|
||||
}{
|
||||
{
|
||||
pairs: []model.LabelPair{{"label1", "x"}},
|
||||
pairs: []model.LabelPair{{Name: "label1", Value: "x"}},
|
||||
expected: fingerprints[:0],
|
||||
},
|
||||
{
|
||||
pairs: []model.LabelPair{{"label1", "test_0"}},
|
||||
pairs: []model.LabelPair{{Name: "label1", Value: "test_0"}},
|
||||
expected: fingerprints[:10],
|
||||
},
|
||||
{
|
||||
pairs: []model.LabelPair{
|
||||
{"label1", "test_0"},
|
||||
{"label1", "test_1"},
|
||||
{Name: "label1", Value: "test_0"},
|
||||
{Name: "label1", Value: "test_1"},
|
||||
},
|
||||
expected: fingerprints[:0],
|
||||
},
|
||||
{
|
||||
pairs: []model.LabelPair{
|
||||
{"label1", "test_0"},
|
||||
{"label2", "test_1"},
|
||||
{Name: "label1", Value: "test_0"},
|
||||
{Name: "label2", Value: "test_1"},
|
||||
},
|
||||
expected: fingerprints[5:10],
|
||||
},
|
||||
{
|
||||
pairs: []model.LabelPair{
|
||||
{"label1", "test_1"},
|
||||
{"label2", "test_2"},
|
||||
{Name: "label1", Value: "test_1"},
|
||||
{Name: "label2", Value: "test_2"},
|
||||
},
|
||||
expected: fingerprints[15:20],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue