Skip to content

Commit

Permalink
storage: Make tests go-vet and golint clean
Browse files Browse the repository at this point in the history
  • Loading branch information
beorn7 committed Dec 13, 2016
1 parent 485ac8d commit 4719482
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion storage/local/chunk/chunk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down
3 changes: 3 additions & 0 deletions storage/local/noop_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions storage/local/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
Expand Down

0 comments on commit 4719482

Please sign in to comment.