@@ -4,25 +4,41 @@ import (
4
4
"context"
5
5
"testing"
6
6
7
+ "github.com/prometheus/common/model"
7
8
"github.com/prometheus/prometheus/pkg/labels"
8
9
"github.com/stretchr/testify/require"
9
10
11
+ "github.com/cortexproject/cortex/pkg/chunk"
12
+ "github.com/cortexproject/cortex/pkg/chunk/encoding"
10
13
"github.com/cortexproject/cortex/pkg/ingester/client"
14
+ "github.com/cortexproject/cortex/pkg/util/chunkcompat"
11
15
"github.com/weaveworks/common/user"
12
16
)
13
17
14
18
func TestIngesterStreaming (t * testing.T ) {
19
+ // We need to make sure that there is atleast one chunk present,
20
+ // else no series will be selected.
21
+ promChunk , err := encoding .NewForEncoding (encoding .Bigchunk )
22
+ require .NoError (t , err )
23
+
24
+ clientChunks , err := chunkcompat .ToChunks ([]chunk.Chunk {
25
+ chunk .NewChunk ("" , 0 , nil , promChunk , model .Earliest , model .Earliest ),
26
+ })
27
+ require .NoError (t , err )
28
+
15
29
d := & mockDistributor {
16
30
r : []client.TimeSeriesChunk {
17
31
{
18
32
Labels : []client.LabelAdapter {
19
33
{Name : "bar" , Value : "baz" },
20
34
},
35
+ Chunks : clientChunks ,
21
36
},
22
37
{
23
38
Labels : []client.LabelAdapter {
24
39
{Name : "foo" , Value : "bar" },
25
40
},
41
+ Chunks : clientChunks ,
26
42
},
27
43
},
28
44
}
0 commit comments