Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiverse "rest" group when running multiple groups #778

Merged
merged 6 commits into from Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/rabbitmq/bunny_test.rb
Expand Up @@ -101,24 +101,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