rabbitmq-server/deps/rabbitmq_mqtt/BUILD.bazel

190 lines
3.7 KiB
Python

load("@rules_erlang//:xref2.bzl", "xref")
load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
load(
"//:rabbitmq.bzl",
"BROKER_VERSION_REQUIREMENTS_ANY",
"RABBITMQ_DIALYZER_OPTS",
"assert_suites",
"broker_for_integration_suites",
"rabbitmq_app",
"rabbitmq_integration_suite",
"rabbitmq_suite",
"rabbitmq_test_helper",
)
APP_NAME = "rabbitmq_mqtt"
APP_DESCRIPTION = "RabbitMQ MQTT Adapter"
APP_MODULE = "rabbit_mqtt"
APP_ENV = """[
{default_user, <<"guest">>},
{default_pass, <<"guest">>},
{ssl_cert_login,false},
%% To satisfy an unfortunate expectation from popular MQTT clients.
{allow_anonymous, true},
{vhost, <<"/">>},
{exchange, <<"amq.topic">>},
{subscription_ttl, 86400000}, %% 24 hours
{retained_message_store, rabbit_mqtt_retained_msg_store_dets},
%% only used by DETS store
{retained_message_store_dets_sync_interval, 2000},
{prefetch, 10},
{ssl_listeners, []},
{tcp_listeners, [1883]},
{num_tcp_acceptors, 10},
{num_ssl_acceptors, 10},
{tcp_listen_options, [{backlog, 128},
{nodelay, true}]},
{proxy_protocol, false},
{sparkplug, false}
]"""
BUILD_DEPS = [
"//deps/rabbitmq_cli:rabbitmqctl",
]
DEPS = [
"//deps/amqp_client:erlang_app",
"//deps/rabbit_common:erlang_app",
"@ra//:erlang_app",
"@ranch//:erlang_app",
]
RUNTIME_DEPS = [
"//deps/rabbit:erlang_app",
]
rabbitmq_app(
app_description = APP_DESCRIPTION,
app_env = APP_ENV,
app_extra_keys = BROKER_VERSION_REQUIREMENTS_ANY,
app_module = APP_MODULE,
app_name = APP_NAME,
build_deps = BUILD_DEPS,
runtime_deps = RUNTIME_DEPS,
deps = DEPS,
)
xref(
additional_libs = BUILD_DEPS,
)
plt(
name = "base_plt",
deps = DEPS,
)
dialyze(
dialyzer_opts = RABBITMQ_DIALYZER_OPTS + ["-Wno_undefined_callbacks"],
plt = ":base_plt",
warnings_as_errors = False,
)
broker_for_integration_suites()
rabbitmq_test_helper(
name = "rabbit_auth_backend_mqtt_mock",
srcs = [
"test/rabbit_auth_backend_mqtt_mock.erl",
],
deps = [
"//deps/rabbit_common:erlang_app",
],
)
PACKAGE = "deps/rabbitmq_mqtt"
rabbitmq_integration_suite(
PACKAGE,
name = "auth_SUITE",
additional_beam = [
":rabbit_auth_backend_mqtt_mock",
],
flaky = True,
runtime_deps = [
"@emqtt//:erlang_app",
],
)
rabbitmq_integration_suite(
PACKAGE,
name = "cluster_SUITE",
size = "large",
flaky = True,
runtime_deps = [
"@emqtt//:erlang_app",
],
)
rabbitmq_integration_suite(
PACKAGE,
name = "command_SUITE",
runtime_deps = [
"@emqtt//:erlang_app",
],
)
rabbitmq_integration_suite(
PACKAGE,
name = "config_schema_SUITE",
)
rabbitmq_integration_suite(
PACKAGE,
name = "java_SUITE",
flaky = True,
)
rabbitmq_suite(
name = "mqtt_machine_SUITE",
size = "small",
)
rabbitmq_suite(
name = "processor_SUITE",
size = "small",
deps = [
"//deps/amqp_client:erlang_app",
"//deps/rabbit_common:erlang_app",
],
)
rabbitmq_integration_suite(
PACKAGE,
name = "proxy_protocol_SUITE",
)
rabbitmq_integration_suite(
PACKAGE,
name = "reader_SUITE",
runtime_deps = [
"@emqtt//:erlang_app",
],
)
rabbitmq_integration_suite(
PACKAGE,
name = "retainer_SUITE",
runtime_deps = [
"@emqtt//:erlang_app",
],
)
rabbitmq_suite(
name = "util_SUITE",
size = "small",
data = [
"test/rabbitmq_mqtt.app",
],
)
assert_suites()
alias(
name = "rabbitmq_mqtt",
actual = ":erlang_app",
visibility = ["//visibility:public"],
)