|
1 | 1 | package collector |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "github.com/google-cloud-tools/kafka-minion/storage" |
5 | 4 | "testing" |
| 5 | + |
| 6 | + "github.com/google-cloud-tools/kafka-minion/storage" |
6 | 7 | ) |
7 | 8 |
|
8 | 9 | func TestGetVersionedConsumerGroups(t *testing.T) { |
@@ -49,6 +50,13 @@ func TestGetVersionedConsumerGroups(t *testing.T) { |
49 | 50 | Offset: 936, |
50 | 51 | Timestamp: 1552723003485, |
51 | 52 | } |
| 53 | + offsets["nongroupedconsumer"] = storage.ConsumerPartitionOffsetMetric{ |
| 54 | + Group: "nongroupedconsumer", |
| 55 | + Topic: "important-topic", |
| 56 | + Partition: 0, |
| 57 | + Offset: 936, |
| 58 | + Timestamp: 1552723003485, |
| 59 | + } |
52 | 60 |
|
53 | 61 | tables := []struct { |
54 | 62 | groupName string |
@@ -89,9 +97,10 @@ func TestParseConsumerGroupName(t *testing.T) { |
89 | 97 | baseName string |
90 | 98 | isLatest bool |
91 | 99 | }{ |
92 | | - {"sample-group-2", 2, "sample-group", false}, |
93 | | - {"sample-group-3", 3, "sample-group", false}, |
| 100 | + {"sample-group-2", 2, "sample-group-", false}, |
| 101 | + {"sample-group-3", 3, "sample-group-", false}, |
94 | 102 | {"another-group", 0, "another-group", false}, |
| 103 | + {"14", 0, "14", false}, |
95 | 104 | } |
96 | 105 | for _, table := range tables { |
97 | 106 | versioned := parseConsumerGroupName(table.groupName) |
|
0 commit comments