Skip to content

Commit cc8720b

Browse files
Merge pull request #11555 from rabbitmq/rabbitmq-server-11554
Tracing: expose directory path setting as tracing.dir
2 parents 6bc258e + 19f6e67 commit cc8720b

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed

deps/rabbitmq_tracing/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
load("@rules_erlang//:eunit2.bzl", "eunit")
22
load("@rules_erlang//:xref2.bzl", "xref")
33
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
4+
load("//:rabbitmq_home.bzl", "rabbitmq_home")
5+
load("//:rabbitmq_run.bzl", "rabbitmq_run")
46
load(
57
"//:rabbitmq.bzl",
68
"BROKER_VERSION_REQUIREMENTS_ANY",
@@ -87,6 +89,10 @@ eunit(
8789

8890
broker_for_integration_suites()
8991

92+
rabbitmq_integration_suite(
93+
name = "config_schema_SUITE",
94+
)
95+
9096
rabbitmq_integration_suite(
9197
name = "rabbit_tracing_SUITE",
9298
)

deps/rabbitmq_tracing/app.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def all_srcs(name = "all_srcs"):
8282
filegroup(
8383
name = "priv",
8484
srcs = [
85+
"priv/schema/rabbitmq_tracing.schema",
8586
"priv/www/js/tmpl/traces.ejs",
8687
"priv/www/js/tracing.js",
8788
],
@@ -128,3 +129,11 @@ def test_suite_beam_files(name = "test_suite_beam_files"):
128129
erlc_opts = "//:test_erlc_opts",
129130
deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"],
130131
)
132+
erlang_bytecode(
133+
name = "config_schema_SUITE_beam_files",
134+
testonly = True,
135+
srcs = ["test/config_schema_SUITE.erl"],
136+
outs = ["test/config_schema_SUITE.beam"],
137+
app_name = "rabbitmq_tracing",
138+
erlc_opts = "//:test_erlc_opts",
139+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
%% This Source Code Form is subject to the terms of the Mozilla Public
2+
%% License, v. 2.0. If a copy of the MPL was not distributed with this
3+
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
%%
5+
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
6+
%%
7+
8+
{mapping, "tracing.dir", "rabbitmq_tracing.directory", [
9+
{datatype, string},
10+
{validators, ["dir_writable"]}]}.
11+
12+
{mapping, "tracing.username", "rabbitmq_tracing.username", [
13+
{datatype, string}
14+
]}.
15+
16+
{mapping, "tracing.password", "rabbitmq_tracing.password", [
17+
{datatype, string}
18+
]}.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
%% This Source Code Form is subject to the terms of the Mozilla Public
2+
%% License, v. 2.0. If a copy of the MPL was not distributed with this
3+
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
4+
%%
5+
%% Copyright (c) 2007-2024 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
6+
%%
7+
8+
-module(config_schema_SUITE).
9+
10+
-compile(export_all).
11+
12+
all() ->
13+
[
14+
run_snippets
15+
].
16+
17+
%% -------------------------------------------------------------------
18+
%% Testsuite setup/teardown.
19+
%% -------------------------------------------------------------------
20+
21+
init_per_suite(Config) ->
22+
rabbit_ct_helpers:log_environment(),
23+
Config1 = rabbit_ct_helpers:run_setup_steps(Config),
24+
rabbit_ct_config_schema:init_schemas(rabbitmq_tracing, Config1).
25+
26+
27+
end_per_suite(Config) ->
28+
rabbit_ct_helpers:run_teardown_steps(Config).
29+
30+
init_per_testcase(Testcase, Config) ->
31+
rabbit_ct_helpers:testcase_started(Config, Testcase),
32+
Config1 = rabbit_ct_helpers:set_config(Config, [
33+
{rmq_nodename_suffix, Testcase}
34+
]),
35+
rabbit_ct_helpers:run_steps(Config1,
36+
rabbit_ct_broker_helpers:setup_steps() ++
37+
rabbit_ct_client_helpers:setup_steps()).
38+
39+
end_per_testcase(Testcase, Config) ->
40+
Config1 = rabbit_ct_helpers:run_steps(Config,
41+
rabbit_ct_client_helpers:teardown_steps() ++
42+
rabbit_ct_broker_helpers:teardown_steps()),
43+
rabbit_ct_helpers:testcase_finished(Config1, Testcase).
44+
45+
%% -------------------------------------------------------------------
46+
%% Testcases.
47+
%% -------------------------------------------------------------------
48+
49+
run_snippets(Config) ->
50+
ok = rabbit_ct_broker_helpers:rpc(Config, 0,
51+
?MODULE, run_snippets1, [Config]).
52+
53+
run_snippets1(Config) ->
54+
rabbit_ct_config_schema:run_snippets(Config).
55+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{tracing_username,
3+
"tracing.username = generated-93da9f621",
4+
[{rabbitmq_tracing, [
5+
{username, "generated-93da9f621"}
6+
]}],
7+
[rabbitmq_trust_store]},
8+
9+
{tracing_password,
10+
"tracing.password = 6bc258e9eac005659a84afcc41be61d93da9f621",
11+
[{rabbitmq_tracing, [
12+
{password, "6bc258e9eac005659a84afcc41be61d93da9f621"}
13+
]}],
14+
[rabbitmq_tracing]}
15+
].

0 commit comments

Comments
 (0)