Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/test-make-target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ jobs:
# restricted to the build jobs to avoid duplication in output.
disable_problem_matchers: true

# We install Erlang problem matchers from ci.erlang.mk.
- name: CHECKOUT ERLANG PROBLEM MATCHERS
uses: actions/checkout@v4
with:
repository: ninenines/ci.erlang.mk
path: ci.erlang.mk

- name: INSTALL ERLANG PROBLEM MATCHERS
run: echo "::add-matcher::ci.erlang.mk/.github/matchers/erlang-matchers.json"

- name: MIXED CLUSTERS - FETCH SIGNING KEYS
uses: dsaltares/fetch-gh-release-asset@master
if: inputs.mixed_clusters
Expand Down Expand Up @@ -120,7 +130,8 @@ jobs:
if: inputs.plugin != 'rabbitmq_cli'
run: |
sudo netstat -ntp
make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }}
set -o pipefail
make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }} NON_DETERMINISTIC=1 2>&1 | sed "s/src\//deps\/${{ inputs.plugin }}\/src\//" | sed "s/test\//deps\/${{ inputs.plugin }}\/test\//" | sed "s/src\/enough\.erl:22:2:/IGNORED src\/enough.erl:22:2:/"

- name: CACHE ACTIVEMQ
uses: actions/cache/save@v4
Expand Down
2 changes: 1 addition & 1 deletion deps/amqp_client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endef
# Release artifacts are put in $(PACKAGES_DIR).
PACKAGES_DIR ?= $(abspath PACKAGES)

LOCAL_DEPS = xmerl ssl public_key
LOCAL_DEPS = ssl public_key
DEPS = rabbit_common credentials_obfuscation
TEST_DEPS = rabbitmq_ct_helpers rabbit meck

Expand Down
2 changes: 1 addition & 1 deletion deps/amqp_client/src/amqp_connection.erl
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ set_connection_name(ConnName,
%% application controller is in the process of shutting down the very
%% application which is making this call.
ensure_started() ->
[ensure_started(App) || App <- [syntax_tools, compiler, xmerl,
[ensure_started(App) || App <- [syntax_tools, compiler,
rabbit_common, amqp_client, credentials_obfuscation]],
ok.

Expand Down
4 changes: 2 additions & 2 deletions deps/oauth2_client/test/system_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,14 @@ get_oauth_provider_given_oauth_provider_id(Config) ->
Jwks_uri)
end.

jwks_url_is_used_in_absense_of_jwks_uri(Config) ->
jwks_url_is_used_in_absense_of_jwks_uri(_Config) ->
{ok, #oauth_provider{
jwks_uri = Jwks_uri}} = oauth2_client:get_oauth_provider([jwks_uri]),
?assertEqual(
proplists:get_value(jwks_url, get_env(key_config, []), undefined),
Jwks_uri).

jwks_uri_takes_precedence_over_jwks_url(Config) ->
jwks_uri_takes_precedence_over_jwks_url(_Config) ->
{ok, #oauth_provider{
jwks_uri = Jwks_uri}} = oauth2_client:get_oauth_provider([jwks_uri]),
?assertEqual(get_env(jwks_uri), Jwks_uri).
Expand Down
2 changes: 1 addition & 1 deletion deps/rabbit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ define PROJECT_ENV
]
endef

LOCAL_DEPS = sasl os_mon inets compiler public_key crypto ssl syntax_tools xmerl
LOCAL_DEPS = sasl os_mon inets compiler public_key crypto ssl syntax_tools

BUILD_DEPS = rabbitmq_cli
DEPS = ranch cowlib rabbit_common amqp10_common rabbitmq_prelaunch ra sysmon_handler stdout_formatter recon redbug observer_cli osiris syslog systemd seshat horus khepri khepri_mnesia_migration cuttlefish gen_batch_server
Expand Down
3 changes: 2 additions & 1 deletion deps/rabbit/test/cluster_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ init_per_group(Group, Config) ->
true ->
Config1 = rabbit_ct_helpers:set_config(Config, [
{rmq_nodename_suffix, Group},
{rmq_nodes_count, 2}
{rmq_nodes_count, 2},
{find_crashes, false} %% we crash some queues on purpose
]),
rabbit_ct_helpers:run_steps(Config1,
rabbit_ct_broker_helpers:setup_steps() ++
Expand Down
3 changes: 2 additions & 1 deletion deps/rabbit/test/crashing_queues_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ end_per_suite(Config) ->

init_per_group(cluster_size_2, Config) ->
rabbit_ct_helpers:set_config(Config, [
{rmq_nodes_count, 2}
{rmq_nodes_count, 2},
{find_crashes, false} %% we crash queues on purpose
]).

end_per_group(_, Config) ->
Expand Down
4 changes: 2 additions & 2 deletions deps/rabbit_common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ define HEX_TARBALL_EXTRA_METADATA
}
endef

LOCAL_DEPS = compiler crypto public_key sasl ssl syntax_tools tools xmerl runtime_tools
LOCAL_DEPS = compiler crypto public_key sasl ssl syntax_tools tools runtime_tools
DEPS = thoas ranch recon credentials_obfuscation

# Variables and recipes in development.*.mk are meant to be used from
Expand All @@ -43,7 +43,7 @@ DEP_EARLY_PLUGINS = $(PROJECT)/mk/rabbitmq-early-plugin.mk
DEP_PLUGINS = $(PROJECT)/mk/rabbitmq-build.mk \
$(PROJECT)/mk/rabbitmq-hexpm.mk

PLT_APPS += mnesia crypto ssl xmerl
PLT_APPS += mnesia crypto ssl

include ../../rabbitmq-components.mk
include ../../erlang.mk
Expand Down
4 changes: 3 additions & 1 deletion deps/rabbit_common/mk/rabbitmq-early-plugin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ CT_OPTS += -kernel net_ticktime 5
#
# cth_styledout
# This hook will change the output of common_test to something more
# concise and colored.
# concise and colored. Not used on GitHub Actions except in parallel CT.

ifndef GITHUB_ACTIONS
CT_HOOKS += cth_styledout
endif
TEST_DEPS += cth_styledout

ifdef CONCOURSE
Expand Down
10 changes: 6 additions & 4 deletions deps/rabbit_common/src/rabbit_binary_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ assert_utf8(B) ->
end.

validate_utf8(Bin) ->
try
_ = xmerl_ucs:from_utf8(Bin),
ok
catch exit:{ucs, _} ->
case unicode:characters_to_binary(Bin, unicode, unicode) of
B when is_binary(B) ->
ok;
{error, _, _} ->
error;
{incomplete, _, _} ->
error
end.
11 changes: 7 additions & 4 deletions deps/rabbit_common/src/rabbit_misc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,13 @@ b64decode_or_throw(B64) ->
end.

utf8_safe(V) ->
try
_ = xmerl_ucs:from_utf8(V),
V
catch exit:{ucs, _} ->
case unicode:characters_to_binary(V, unicode, unicode) of
B when is_binary(B) ->
B;
{error, _, _} ->
Enc = split_lines(base64:encode(V)),
<<"Not UTF-8, base64 is: ", Enc/binary>>;
{incomplete, _, _} ->
Enc = split_lines(base64:encode(V)),
<<"Not UTF-8, base64 is: ", Enc/binary>>
end.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
{'_', [{Path, oauth2_http_mock, Expected} ||
#{request := #{path := Path}} = Expected <- Expectations ]}
]),
{ok, Pid} = cowboy:start_tls(
{ok, _Pid} = cowboy:start_tls(
mock_http_auth_listener,
[{port, Port},
{certfile, filename:join([CertsDir, "server", "cert.pem"])},
Expand Down
1 change: 0 additions & 1 deletion deps/rabbitmq_cli/test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ if function_exported?(Mix, :ensure_application!, 1) do
Mix.ensure_application!(:public_key)
Mix.ensure_application!(:runtime_tools)
Mix.ensure_application!(:sasl)
Mix.ensure_application!(:xmerl)
end

defmodule TestHelper do
Expand Down
18 changes: 16 additions & 2 deletions deps/rabbitmq_ct_helpers/src/ct_master_fork.erl
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,28 @@ master_print_summary_for(Title,List) ->
_ = case List of
[] -> ok;
_ ->
Chars = [
Chars = [[
master_format_gh_anno(Reason),
io_lib:format("Node: ~w~nCase: ~w:~w~nReason: ~p~n~n",
[Node, Suite, FuncOrGroup, Reason])
|| {Node, Suite, FuncOrGroup, Reason} <- List],
] || {Node, Suite, FuncOrGroup, Reason} <- List],
log(all,Title,Chars,[])
end,
ok.

master_format_gh_anno({error, {{exception, Reason, [{Mod, Fun, Arity, Loc}|_]}, _}}) ->
%% We use .github because that file exists in our repository
%% so GH will still put annotations in pull requests even
%% if we don't have the real file name.
File = proplists:get_value(file, Loc, ".github"),
Line = proplists:get_value(line, Loc, 0),
io_lib:format("::error file=~s,line=~b::~w:~tw/~b: ~w~n",
[File, Line, Mod, Fun, Arity, Reason]);
master_format_gh_anno(Reason) ->
%% Do the bare minimum if we don't know the error reason.
io_lib:format("::error file=.github,line=0::~w~n",
[Reason]).

update_queue(take,Node,From,Lock={Op,Resource},Locks,Blocked) ->
%% Locks: [{{Operation,Resource},Node},...]
%% Blocked: [{{Operation,Resource},Node,WaitingPid},...]
Expand Down
3 changes: 0 additions & 3 deletions deps/rabbitmq_management/test/rabbit_mgmt_wm_auth_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,6 @@ end_per_group(with_oauth_disable_basic_auth_false, Config) ->
end_per_group(with_resource_server_id_rabbit, Config) ->
unset_env(rabbitmq_auth_backend_oauth2, resource_server_id),
Config;
end_per_group(with_default_oauth_provider_idp1, Config) ->
unset_env(rabbitmq_auth_backend_oauth2, default_oauth_provider),
Config;
end_per_group(with_mgt_oauth_provider_url_url0, Config) ->
unset_env(rabbitmq_management, oauth_provider_url),
Config;
Expand Down
2 changes: 1 addition & 1 deletion deps/rabbitmq_management_agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endef

DEPS = rabbit_common rabbit rabbitmq_web_dispatch
TEST_DEPS = rabbitmq_ct_helpers rabbitmq_ct_client_helpers
LOCAL_DEPS += xmerl ranch ssl crypto public_key
LOCAL_DEPS += ranch ssl crypto public_key

PLT_APPS += rabbitmq_cli

Expand Down
9 changes: 0 additions & 9 deletions deps/rabbitmq_web_stomp/test/cowboy_websocket_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ groups() ->
[
{integration, [],
[
connection_succeeds,
connection_fails,
pubsub,
pubsub_binary,
Expand Down Expand Up @@ -91,14 +90,6 @@ end_per_testcase(http_auth, Config) ->
end_per_testcase(_, Config) -> Config.


connection_succeeds(Config) ->
PortStr = rabbit_ws_test_util:get_web_stomp_port_str(Config),
Protocol = ?config(protocol, Config),
WS = rfc6455_client:new(Protocol ++ "://127.0.0.1:" ++ PortStr ++ "/ws", self()),
{ok, _} = rfc6455_client:open(WS),
{close, _} = rfc6455_client:close(WS),
ok.

connection_fails(Config) ->
PortStr = rabbit_ws_test_util:get_web_stomp_port_str(Config),
Protocol = ?config(protocol, Config),
Expand Down
Loading