summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Lebedeff <binarin@binarin.info>2021-09-22 11:24:20 +0200
committerAlexey Lebedeff <binarin@binarin.info>2021-09-22 15:23:35 +0200
commit5501d07b8b9bb2e16dcf5c7ee45298826ca68bb2 (patch)
treecf7e1bde00d306a1b862859f8a6c6df76a677ea5
parentcb8a397d52be2a145e09a6c49ba2cb5afcdb6d29 (diff)
downloadrabbitmq-server-git-5501d07b8b9bb2e16dcf5c7ee45298826ca68bb2.tar.gz
Use rabbitmq_ct_helpers to allocate prometheus portuse-ct-helpers-for-prometheus-port
This test always used standard 15692 before, which were causing conflicts with e.g. local `make run-broker`.
-rw-r--r--WORKSPACE.bazel2
-rw-r--r--deps/rabbitmq_prometheus/test/rabbit_prometheus_http_SUITE.erl10
2 files changed, 3 insertions, 9 deletions
diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel
index a800cceee8..4bb5bcb6cb 100644
--- a/WORKSPACE.bazel
+++ b/WORKSPACE.bazel
@@ -45,7 +45,7 @@ rabbitmq_external_deps(rabbitmq_workspace = "@")
git_repository(
name = "rabbitmq_ct_helpers",
- commit = "9a848f06e432262ab30e6124e52564714662f47b",
+ commit = "f709a6f6a2345d3ab5076469cb8d8e42e89b2b59",
remote = "https://github.com/rabbitmq/rabbitmq-ct-helpers.git",
repo_mapping = {
"@rabbitmq-server": "@",
diff --git a/deps/rabbitmq_prometheus/test/rabbit_prometheus_http_SUITE.erl b/deps/rabbitmq_prometheus/test/rabbit_prometheus_http_SUITE.erl
index b903410057..a8c80afd98 100644
--- a/deps/rabbitmq_prometheus/test/rabbit_prometheus_http_SUITE.erl
+++ b/deps/rabbitmq_prometheus/test/rabbit_prometheus_http_SUITE.erl
@@ -18,7 +18,6 @@ all() ->
[
{group, default_config},
{group, config_path},
- {group, config_port},
{group, aggregated_metrics},
{group, per_object_metrics},
{group, per_object_endpoint_metrics},
@@ -30,7 +29,6 @@ groups() ->
[
{default_config, [], generic_tests()},
{config_path, [], generic_tests()},
- {config_port, [], generic_tests()},
{aggregated_metrics, [], [
aggregated_metrics_test,
specific_erlang_metrics_present_test,
@@ -79,10 +77,6 @@ init_per_group(config_path, Config0) ->
PathConfig = {rabbitmq_prometheus, [{path, "/bunnieshop"}]},
Config1 = rabbit_ct_helpers:merge_app_env(Config0, PathConfig),
init_per_group(config_path, Config1, [{prometheus_path, "/bunnieshop"}]);
-init_per_group(config_port, Config0) ->
- PathConfig = {rabbitmq_prometheus, [{tcp_config, [{port, 15772}]}]},
- Config1 = rabbit_ct_helpers:merge_app_env(Config0, PathConfig),
- init_per_group(config_port, Config1, [{prometheus_port, 15772}]);
init_per_group(per_object_metrics, Config0) ->
PathConfig = {rabbitmq_prometheus, [{return_per_object_metrics, true}]},
Config1 = rabbit_ct_helpers:merge_app_env(Config0, PathConfig),
@@ -269,7 +263,7 @@ get_test(Config) ->
{_Headers, Body} = http_get_with_pal(Config, [], 200),
%% Check that the body looks like a valid response
?assertEqual(match, re:run(Body, "TYPE", [{capture, none}])),
- Port = proplists:get_value(prometheus_port, Config, 15692),
+ Port = rabbit_mgmt_test_util:config_port(Config, tcp_port_prometheus),
URI = lists:flatten(io_lib:format("http://localhost:~p/metricsooops", [Port])),
{ok, {{_, CodeAct, _}, _, _}} = httpc:request(get, {URI, []}, ?HTTPC_OPTS, []),
?assertMatch(404, CodeAct).
@@ -498,7 +492,7 @@ http_get(Config, ReqHeaders, CodeExp) ->
http_get(Config, Path, ReqHeaders, CodeExp).
http_get(Config, Path, ReqHeaders, CodeExp) ->
- Port = proplists:get_value(prometheus_port, Config, 15692),
+ Port = rabbit_mgmt_test_util:config_port(Config, tcp_port_prometheus),
URI = lists:flatten(io_lib:format("http://localhost:~p~s", [Port, Path])),
{ok, {{_HTTP, CodeAct, _}, Headers, Body}} =
httpc:request(get, {URI, ReqHeaders}, ?HTTPC_OPTS, []),