Skip to content

Commit

Permalink
Added test data to assert RabbitMQ scaler custom metricName.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtnpro committed Aug 2, 2021
1 parent 03316de commit dea79f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/scalers/rabbitmq_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ var testRabbitMQMetadata = []parseRabbitMQMetadataTestData{
{map[string]string{"mode": "MessageRate", "value": "1000", "queueName": "sample", "host": "http://", "useRegex": "true"}, false, map[string]string{}},
// queue length and useRegex
{map[string]string{"mode": "QueueLength", "value": "1000", "queueName": "sample", "host": "http://", "useRegex": "true"}, false, map[string]string{}},
// custom metric name
{map[string]string{"mode": "QueueLength", "value": "1000", "queueName": "sample", "host": "http://", "useRegex": "true", "metricName": "host1-sample"}, false, map[string]string{}},
}

var rabbitMQMetricIdentifiers = []rabbitMQMetricIdentifier{
{&testRabbitMQMetadata[1], "rabbitmq-sample"},
{&testRabbitMQMetadata[7], "rabbitmq-namespace-name"},
{&testRabbitMQMetadata[31], "rabbitmq-host1-sample"},
}

func TestRabbitMQParseMetadata(t *testing.T) {
Expand Down

0 comments on commit dea79f6

Please sign in to comment.