summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BAZEL.md2
-rw-r--r--deps/rabbitmq_cli/rabbitmqctl.bzl2
-rw-r--r--deps/rabbitmq_ct_helpers/BUILD.bazel4
-rw-r--r--deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl4
-rw-r--r--deps/rabbitmq_ct_helpers/tools/tls-certs/BUILD.bazel4
-rw-r--r--deps/rabbitmq_stomp/BUILD.bazel1
-rw-r--r--deps/rabbitmq_web_dispatch/BUILD.bazel6
-rw-r--r--deps/rabbitmq_web_dispatch/test/rabbit_web_dispatch_SUITE.erl5
-rw-r--r--deps/rabbitmq_web_mqtt/BUILD.bazel1
-rw-r--r--rabbitmq.bzl10
10 files changed, 17 insertions, 22 deletions
diff --git a/BAZEL.md b/BAZEL.md
index 0735e997fc..9ab05a12cf 100644
--- a/BAZEL.md
+++ b/BAZEL.md
@@ -35,7 +35,7 @@ Create a `user.bazelrc` by making a copy of `user-template.bazelrc` and updating
### Running tests
-Many rabbit tests spawn single or clustered rabbit nodes, and therefore it's best to run test suites sequentially on a single machine. Hence the `build --local_test_jobs=1` flag used in `.bazelrc`. Additionally, it may be reasonable to disable test sharding and stream test output when running tests locally with `--test_sharding_strategy=disabled` & `--test_output=streamed` additional arguments. Naturally that restriction does not hold if utilizing remote execution (as is the case for RabbitMQ's CI pipelines).
+Many rabbit tests spawn single or clustered rabbit nodes, and therefore it's best to run test suites sequentially on a single machine. Hence the `build --local_test_jobs=1` flag used in `.bazelrc`. Additionally, it may be reasonable to disable test sharding and stream test output when running tests locally with `--test_output=streamed` as an additional argument (to just disable sharding, but not stream output, use `--test_sharding_strategy=disabled`). Naturally that restriction does not hold if utilizing remote execution (as is the case for RabbitMQ's CI pipelines).
Erlang Common Test logs will not be placed in the logs directory when run with bazel. They can be found under `bazel-testlogs`. For instance, those of the rabbit application's backing_queue suite will be under `bazel-testlogs/deps/rabbit/backing_queue_SUITE/test.outputs/`.
diff --git a/deps/rabbitmq_cli/rabbitmqctl.bzl b/deps/rabbitmq_cli/rabbitmqctl.bzl
index 5c393926b6..f28c1fa692 100644
--- a/deps/rabbitmq_cli/rabbitmqctl.bzl
+++ b/deps/rabbitmq_cli/rabbitmqctl.bzl
@@ -131,7 +131,7 @@ def _impl(ctx):
deps = flat_deps(ctx.attr.deps)
runfiles = ctx.runfiles([ebin])
- for dep in ctx.attr.deps:
+ for dep in deps:
runfiles = runfiles.merge(dep[DefaultInfo].default_runfiles)
return [
diff --git a/deps/rabbitmq_ct_helpers/BUILD.bazel b/deps/rabbitmq_ct_helpers/BUILD.bazel
index bd5d16299e..bdb45b0fa7 100644
--- a/deps/rabbitmq_ct_helpers/BUILD.bazel
+++ b/deps/rabbitmq_ct_helpers/BUILD.bazel
@@ -7,4 +7,8 @@ erlang_lib(
"@proper//:bazel_erlang_lib",
"//deps/rabbit_common:bazel_erlang_lib",
],
+ extra_priv = [
+ "tools/tls-certs/Makefile",
+ "tools/tls-certs/openssl.cnf.in",
+ ],
)
diff --git a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl
index ca30c7128f..97e8b66017 100644
--- a/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl
+++ b/deps/rabbitmq_ct_helpers/src/rabbit_ct_helpers.erl
@@ -482,7 +482,9 @@ load_rabbitmqctl_app(Config) ->
Config;
{error, {already_loaded, rabbitmqctl}} ->
Config;
- {error, _} ->
+ {error, Reason} ->
+ ct:pal(?LOW_IMPORTANCE,
+ "Failed to load rabbitmqctl application: ~p", [Reason]),
{skip, "Application rabbitmqctl could not be loaded, " ++
"please place compiled rabbitmq_cli on the code path"}
end.
diff --git a/deps/rabbitmq_ct_helpers/tools/tls-certs/BUILD.bazel b/deps/rabbitmq_ct_helpers/tools/tls-certs/BUILD.bazel
deleted file mode 100644
index 0495ada921..0000000000
--- a/deps/rabbitmq_ct_helpers/tools/tls-certs/BUILD.bazel
+++ /dev/null
@@ -1,4 +0,0 @@
-exports_files([
- "Makefile",
- "openssl.cnf.in",
-])
diff --git a/deps/rabbitmq_stomp/BUILD.bazel b/deps/rabbitmq_stomp/BUILD.bazel
index fd16cfbf94..7204e3d0c7 100644
--- a/deps/rabbitmq_stomp/BUILD.bazel
+++ b/deps/rabbitmq_stomp/BUILD.bazel
@@ -87,6 +87,7 @@ erlc(
"src/**/*.hrl",
]),
erlc_opts = RABBITMQ_TEST_ERLC_OPTS,
+ dest = "test",
deps = [
":test_bazel_erlang_lib",
],
diff --git a/deps/rabbitmq_web_dispatch/BUILD.bazel b/deps/rabbitmq_web_dispatch/BUILD.bazel
index 801990d8be..d8395dfaab 100644
--- a/deps/rabbitmq_web_dispatch/BUILD.bazel
+++ b/deps/rabbitmq_web_dispatch/BUILD.bazel
@@ -43,9 +43,6 @@ test_erlang_lib(
app_name = APP_NAME,
app_version = APP_VERSION,
extra_apps = EXTRA_APPS,
- extra_priv = [
- "test/priv/www/index.html",
- ],
deps = DEPS,
)
@@ -84,6 +81,9 @@ suites = [
rabbitmq_integration_suite(
PACKAGE,
name = "rabbit_web_dispatch_SUITE",
+ data = [
+ "test/priv/www/index.html",
+ ],
),
rabbitmq_suite(
name = "rabbit_web_dispatch_unit_SUITE",
diff --git a/deps/rabbitmq_web_dispatch/test/rabbit_web_dispatch_SUITE.erl b/deps/rabbitmq_web_dispatch/test/rabbit_web_dispatch_SUITE.erl
index 17d50f81db..115c0cfbac 100644
--- a/deps/rabbitmq_web_dispatch/test/rabbit_web_dispatch_SUITE.erl
+++ b/deps/rabbitmq_web_dispatch/test/rabbit_web_dispatch_SUITE.erl
@@ -71,12 +71,9 @@ query_static_resource_test1(Host, Port) ->
rabbit_web_dispatch:register_static_context(test, [{port, Port}],
"rabbit_web_dispatch_test",
?MODULE, "test/priv/www", "Test"),
- inets:start(),
{ok, {_Status, _Headers, Body}} =
httpc:request(format("http://~s:~w/rabbit_web_dispatch_test/index.html", [Host, Port])),
- ?assert(string:str(Body, "RabbitMQ HTTP Server Test Page") /= 0),
-
- passed.
+ ?assertMatch(I when I > 0, string:str(Body, "RabbitMQ HTTP Server Test Page")).
add_idempotence_test(Config) ->
Port = rabbit_ct_broker_helpers:get_node_config(Config, 0, tcp_port_http_extra),
diff --git a/deps/rabbitmq_web_mqtt/BUILD.bazel b/deps/rabbitmq_web_mqtt/BUILD.bazel
index b0635a7351..a2322a10c0 100644
--- a/deps/rabbitmq_web_mqtt/BUILD.bazel
+++ b/deps/rabbitmq_web_mqtt/BUILD.bazel
@@ -67,6 +67,7 @@ erlc(
name = "test_utils",
srcs = glob(["test/src/*.erl"]),
hdrs = glob(["test/src/*.hrl"]),
+ dest = "test",
erlc_opts = RABBITMQ_TEST_ERLC_OPTS,
)
diff --git a/rabbitmq.bzl b/rabbitmq.bzl
index 429b41a061..e9e21d561b 100644
--- a/rabbitmq.bzl
+++ b/rabbitmq.bzl
@@ -128,10 +128,7 @@ def rabbitmq_integration_suite(
erlc_opts = RABBITMQ_TEST_ERLC_OPTS + erlc_opts,
additional_hdrs = additional_hdrs,
additional_srcs = additional_srcs,
- data = [
- "//deps/rabbitmq_ct_helpers/tools/tls-certs:Makefile",
- "//deps/rabbitmq_ct_helpers/tools/tls-certs:openssl.cnf.in",
- ] + data,
+ data = data,
test_env = dict({
"SKIP_MAKE_TEST_DIST": "true",
"RABBITMQ_CT_SKIP_AS_ERROR": "true",
@@ -160,10 +157,7 @@ def rabbitmq_integration_suite(
name = name + "-mixed",
suite_name = name,
tags = tags + ["mixed-version-cluster"],
- data = [
- "//deps/rabbitmq_ct_helpers/tools/tls-certs:Makefile",
- "//deps/rabbitmq_ct_helpers/tools/tls-certs:openssl.cnf.in",
- ] + data,
+ data = data,
test_env = dict({
"SKIP_MAKE_TEST_DIST": "true",
"RABBITMQ_FEATURE_FLAGS": "",