storage: Make tests go-vet and golint clean

pull/2276/head
beorn7 2016-12-13 16:57:49 +01:00
parent 485ac8dff7
commit 4719482f5f
3 changed files with 15 additions and 9 deletions

View File

@ -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]
}
}

View File

@ -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.

View File

@ -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],
},