Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Brouwer <[email protected]>
  • Loading branch information
rickbrouwer committed Jan 18, 2025
1 parent d7293a7 commit 04f6764
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/scalers/redis_streams_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,30 @@ func TestParseRedisClusterStreamsMetadata(t *testing.T) {
},
wantErr: nil,
},
{
name: "zero activation lag count with lag count is allowed",
metadata: map[string]string{
"stream": "my-stream",
"lagCount": "7",
"activationLagCount": "0",
"consumerGroup": "consumer1",
},
authParams: map[string]string{
"addresses": ":7001, :7002",
},
wantMeta: &redisStreamsMetadata{
StreamName: "my-stream",
TargetPendingEntriesCount: 0,
TargetLag: 7,
ActivationLagCount: 0,
ConsumerGroupName: "consumer1",
ConnectionInfo: redisConnectionInfo{
Addresses: []string{":7001", ":7002"},
},
scaleFactor: lagFactor,
},
wantErr: nil,
},
{
name: "address is defined in auth params",
metadata: map[string]string{
Expand Down

0 comments on commit 04f6764

Please sign in to comment.