Skip to content

Commit

Permalink
Merge pull request #778 from newrelic/add_bunny_to_group
Browse files Browse the repository at this point in the history
Fix multiverse "rest" group when running multiple groups
  • Loading branch information
kaylareopelle committed Sep 17, 2021
2 parents afba4f8 + 22747de commit 00887c7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
18 changes: 12 additions & 6 deletions test/multiverse/lib/multiverse/runner.rb
Expand Up @@ -128,20 +128,26 @@ def passes_filter?(dir, filter)
return false if excluded?(dir)

if filter.include?("group=")
keys = filter.sub("group=", "").split(';')
keys = filter.sub("group=", "").split(';') # supports multiple groups passed in ";" delimited
combined_groups = []

# grabs all the suites that are in each of the groups passed in
keys.each do |key|
(combined_groups << (GROUPS[key])).flatten!
end


# checks for malformed groups passed in
if combined_groups.nil?
puts red("Unrecognized groups in '#{filter}'. Stopping!")
exit 1
elsif combined_groups.any?
combined_groups.include?(dir)
else
!GROUPS.values.flatten.include?(dir)
end

# This allows the "rest" group to be passed in as one of several groups that are ';' delimited
# true IF
# the "rest" group is one of the groups being passed in AND the directory is not in any other group
# OR
# the directory is one of the suites included in one of the non-rest groups passed in
(keys.include?("rest") && !GROUPS.values.flatten.include?(dir) ) || (combined_groups.any? && combined_groups.include?(dir))
else
dir.include?(filter)
end
Expand Down
36 changes: 19 additions & 17 deletions test/multiverse/suites/bunny/bunny_test.rb
Expand Up @@ -103,24 +103,26 @@ def test_metrics_recorded_for_consume_from_a_named_exchange
end

def test_segment_parameters_recorded_for_produce
x = @chan.fanout "activity.events"
headers = {foo: "bar"}
in_transaction "test_txn" do
x.publish "howdy", {
routing_key: "red",
headers: headers,
reply_to: "blue",
correlation_id: "abc"
}
with_config(:'distributed_tracing.enabled' => false) do
x = @chan.fanout "activity.events"
headers = {foo: "bar"}
in_transaction "test_txn" do
x.publish "howdy", {
routing_key: "red",
headers: headers,
reply_to: "blue",
correlation_id: "abc"
}
end

node = find_node_with_name_matching last_transaction_trace, /^MessageBroker\//

assert_equal :fanout, node.params[:exchange_type]
assert_equal "red", node.params[:routing_key]
assert_equal headers, node.params[:headers]
assert_equal "blue", node.params[:reply_to]
assert_equal "abc", node.params[:correlation_id]
end

node = find_node_with_name_matching last_transaction_trace, /^MessageBroker\//

assert_equal :fanout, node.params[:exchange_type]
assert_equal "red", node.params[:routing_key]
assert_equal headers, node.params[:headers]
assert_equal "blue", node.params[:reply_to]
assert_equal "abc", node.params[:correlation_id]
end

def test_segment_parameters_recorded_for_consume
Expand Down

0 comments on commit 00887c7

Please sign in to comment.