Skip to content

Commit e00d83a

Browse files
committed
Shovel tests: ignore nodename
CI uses a different hostname
1 parent 47510a6 commit e00d83a

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

deps/rabbitmq_shovel/test/amqp10_SUITE.erl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,6 @@ amqp10_destination(Config, AckMode) ->
117117
}},
118118
publish(Chan, Msg, ?EXCHANGE, ?TO_SHOVEL),
119119

120-
[NodeA] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
121-
Node = atom_to_binary(NodeA),
122-
123120
receive
124121
{amqp10_msg, Receiver, InMsg} ->
125122
[<<42>>] = amqp10_msg:body(InMsg),
@@ -142,7 +139,7 @@ amqp10_destination(Config, AckMode) ->
142139
#{<<"x-basic-type">> := ?UNSHOVELLED,
143140
<<"x-opt-shovel-type">> := <<"static">>,
144141
<<"x-opt-shovel-name">> := <<"test_shovel">>,
145-
<<"x-opt-shovelled-by">> := Node,
142+
<<"x-opt-shovelled-by">> := _,
146143
<<"x-opt-shovelled-timestamp">> := _},
147144
amqp10_msg:message_annotations(InMsg)),
148145
?assertMatch(#{durable := true}, amqp10_msg:headers(InMsg)),

deps/rabbitmq_shovel/test/local_SUITE.erl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,9 @@ local_destination_forward_headers_amqp10(Config) ->
168168
Msg = #amqp_msg{props = #'P_basic'{}},
169169
publish(Chan, Msg, ?EXCHANGE, ?TO_SHOVEL),
170170

171-
[NodeA] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
172-
Node = atom_to_binary(NodeA),
173-
174171
receive
175172
{amqp10_msg, Receiver, InMsg} ->
176-
?assertMatch(#{<<"x-opt-shovelled-by">> := Node,
173+
?assertMatch(#{<<"x-opt-shovelled-by">> := _,
177174
<<"x-opt-shovel-type">> := <<"static">>,
178175
<<"x-opt-shovel-name">> := <<"test_shovel">>},
179176
amqp10_msg:message_annotations(InMsg))
@@ -196,16 +193,12 @@ local_destination_forward_headers_amqp091(Config) ->
196193
Msg = #amqp_msg{props = #'P_basic'{}},
197194
publish(Chan, Msg, ?EXCHANGE, ?TO_SHOVEL),
198195

199-
[NodeA] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
200-
Node = atom_to_binary(NodeA),
201-
ExpectedHeaders = lists:sort(
202-
[{<<"x-opt-shovelled-by">>, longstr, Node},
203-
{<<"x-opt-shovel-type">>, longstr, <<"static">>},
204-
{<<"x-opt-shovel-name">>, longstr, <<"test_shovel">>}]),
205196
receive
206197
{#'basic.deliver'{consumer_tag = CTag},
207198
#amqp_msg{props = #'P_basic'{headers = Headers}}} ->
208-
?assertMatch(ExpectedHeaders,
199+
?assertMatch([{<<"x-opt-shovel-name">>, longstr, <<"test_shovel">>},
200+
{<<"x-opt-shovel-type">>, longstr, <<"static">>},
201+
{<<"x-opt-shovelled-by">>, longstr, _}],
209202
lists:sort(Headers))
210203
after ?TIMEOUT -> throw(timeout_waiting_for_deliver1)
211204
end,

0 commit comments

Comments
 (0)