Incorporate feedback on #36

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-04-22 01:38:26 +05:30
parent 239f8b9eb5
commit 725b69caa1
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD
3 changed files with 118 additions and 111 deletions

View File

@ -1,8 +1,7 @@
package tsdb
import (
"errors"
"github.com/pkg/errors"
"github.com/prometheus/tsdb/chunks"
)

View File

@ -138,7 +138,7 @@ func TestMultiMerge(t *testing.T) {
}
}
func TestMerge(t *testing.T) {
func TestMergedPostings(t *testing.T) {
var cases = []struct {
a, b []uint32
res []uint32
@ -169,7 +169,9 @@ func TestMerge(t *testing.T) {
require.Equal(t, c.res, res)
}
t.Run("Seek", func(t *testing.T) {
}
func TestMergedPostingsSeek(t *testing.T) {
var cases = []struct {
a, b []uint32
@ -234,7 +236,6 @@ func TestMerge(t *testing.T) {
}
return
})
}
func TestBigEndian(t *testing.T) {

View File

@ -261,12 +261,26 @@ func TestBlockQuerier(t *testing.T) {
}
}
// Build the querier on data first. Then execute queries on it.
basedata := [][]struct {
type query struct {
dataIdx int
mint, maxt int64
ms []labels.Matcher
exp SeriesSet
}
cases := struct {
data []struct {
lset map[string]string
chunks [][]sample
}
queries []query
}{
data: []struct {
lset map[string]string
chunks [][]sample
}{
{
{
lset: map[string]string{
"a": "a",
@ -308,15 +322,8 @@ func TestBlockQuerier(t *testing.T) {
},
},
},
}
cases := []struct {
dataIdx int
mint, maxt int64
ms []labels.Matcher
exp SeriesSet
}{
queries: []query{
{
dataIdx: 0,
@ -361,12 +368,12 @@ func TestBlockQuerier(t *testing.T) {
),
}),
},
},
}
Outer:
for _, c := range cases {
ir, cr := createIdxChkReaders(basedata[c.dataIdx])
for _, c := range cases.queries {
ir, cr := createIdxChkReaders(cases.data)
querier := &blockQuerier{
index: ir,
chunks: cr,