Skip to content

Commit ab8814a

Browse files
committed
Fix error message
Prior to this commit if dotnet or mvnw failed to fetch test dependencies, for example because dotnet isn't installed, the test setup crashed in an unexpected way: ``` amqp_system_SUITE > dotnet {'EXIT', {badarg, [{lists,keysearch, [rmq_nodes,1, {skip, "Failed to fetch .NET Core test project dependencies"}], [{error_info,#{module => erl_stdlib_errors}}]}, {test_server,lookup_config,2, [{file,"test_server.erl"},{line,1779}]}, {rabbit_ct_broker_helpers,get_node_configs,2, [{file,"rabbit_ct_broker_helpers.erl"},{line,1411}]}, {rabbit_ct_broker_helpers,enable_feature_flag,2, [{file,"rabbit_ct_broker_helpers.erl"},{line,1999}]}, {amqp_system_SUITE,init_per_group,2, [{file,"amqp_system_SUITE.erl"},{line,77}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1794}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1391}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,1235}]}]}} ``` This commit improves the error message instead of failing with `badarg`. This commit also decides to fail the test setup instead of skipping the suite because we always want CI to execute this test and be notified instead of silently skipping if the test can't be run.
1 parent af15166 commit ab8814a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

deps/rabbit/test/amqp_system_SUITE.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ build_dotnet_test_project(Config) ->
9898
rabbit_ct_helpers:set_config(
9999
Config, {dotnet_test_project_dir, TestProjectDir});
100100
_ ->
101-
{skip, "Failed to fetch .NET Core test project dependencies"}
101+
ct:fail({"'dotnet restore' failed", Ret})
102102
end.
103103

104104
build_maven_test_project(Config) ->
105105
TestProjectDir = filename:join([?config(data_dir, Config), "java-tests"]),
106106
Ret = rabbit_ct_helpers:exec([TestProjectDir ++ "/mvnw", "test-compile"],
107-
[{cd, TestProjectDir}]),
107+
[{cd, TestProjectDir}]),
108108
case Ret of
109109
{ok, _} ->
110110
rabbit_ct_helpers:set_config(Config,
111-
{maven_test_project_dir, TestProjectDir});
111+
{maven_test_project_dir, TestProjectDir});
112112
_ ->
113-
{skip, "Failed to build Maven test project"}
113+
ct:fail({"'mvnw test-compile' failed", Ret})
114114
end.
115115

116116
%% -------------------------------------------------------------------

0 commit comments

Comments
 (0)