(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func 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 | |
| 47 | func TestShuffleShardExpectedInstances(t *testing.T) { |
| 48 | tests := []struct { |
nothing calls this directly
no test coverage detected