Skip to content

Commit

Permalink
Uncomment AMQP application property filter test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Oct 14, 2024
1 parent 0229985 commit 8115eb3
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,37 +177,35 @@ func TestPublishWithPriorities(t *testing.T) {
}
}

// TODO enable once https://github.com/rabbitmq/rabbitmq-server/pull/12415 is merged
//
// func TestAMQPStreamFilters(t *testing.T) {
// defer metrics.Reset()
//
// rootCmd := RootCmd()
//
// args := []string{"amqp",
// "-C", "6",
// "--publish-to", "/queues/stream-with-filters",
// "--consume-from", "/queues/stream-with-filters",
// "--amqp-app-property", "key1=foo,bar,baz",
// "--amqp-app-property-filter", "key1=$p:ba",
// "--queues", "stream",
// "--cleanup-queues=true",
// "--time", "2s",
// }
//
// rootCmd.SetArgs(args)
// fmt.Println("Running test: omq", strings.Join(args, " "))
// err := rootCmd.Execute()
// assert.Nil(t, err)
//
// assert.Eventually(t, func() bool {
// return 6 == metrics.MessagesPublished.Get()
//
// }, 2*time.Second, 100*time.Millisecond)
// assert.Eventually(t, func() bool {
// return 4 == metrics.MessagesConsumedNormalPriority.Get()
// }, 2*time.Second, 100*time.Millisecond)
// }
func TestAMQPStreamFilters(t *testing.T) {
defer metrics.Reset()

rootCmd := RootCmd()

args := []string{"amqp",
"-C", "6",
"--publish-to", "/queues/stream-with-filters",
"--consume-from", "/queues/stream-with-filters",
"--amqp-app-property", "key1=foo,bar,baz",
"--amqp-app-property-filter", "key1=$p:ba",
"--queues", "stream",
"--cleanup-queues=true",
"--time", "2s",
}

rootCmd.SetArgs(args)
fmt.Println("Running test: omq", strings.Join(args, " "))
err := rootCmd.Execute()
assert.Nil(t, err)

assert.Eventually(t, func() bool {
return 6 == metrics.MessagesPublished.Get()

}, 2*time.Second, 100*time.Millisecond)
assert.Eventually(t, func() bool {
return 4 == metrics.MessagesConsumedNormalPriority.Get()
}, 2*time.Second, 100*time.Millisecond)
}

func TestFanInFromMQTTtoAMQP(t *testing.T) {
defer metrics.Reset()
Expand Down

0 comments on commit 8115eb3

Please sign in to comment.