MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestShuffleShardExpectedInstancesPerZone

Function TestShuffleShardExpectedInstancesPerZone

pkg/util/shard_test.go:9–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestShuffleShardExpectedInstancesPerZone(t *testing.T) {
10 tests := []struct {
11 shardSize int
12 numZones int
13 expected int
14 }{
15 {
16 shardSize: 1,
17 numZones: 1,
18 expected: 1,
19 },
20 {
21 shardSize: 1,
22 numZones: 3,
23 expected: 1,
24 },
25 {
26 shardSize: 3,
27 numZones: 3,
28 expected: 1,
29 },
30 {
31 shardSize: 4,
32 numZones: 3,
33 expected: 2,
34 },
35 {
36 shardSize: 6,
37 numZones: 3,
38 expected: 2,
39 },
40 }
41
42 for _, test := range tests {
43 assert.Equal(t, test.expected, ShuffleShardExpectedInstancesPerZone(test.shardSize, test.numZones))
44 }
45}
46
47func TestShuffleShardExpectedInstances(t *testing.T) {
48 tests := []struct {

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.65

Tested by

no test coverage detected