rabbitmq-server/deps/rabbitmq_cli/BUILD.bazel

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

146 lines
3.6 KiB
Python
Raw Normal View History

load("@rules_erlang//:dialyze.bzl", "dialyze", "plt")
load(":rabbitmqctl.bzl", "rabbitmqctl")
load(":rabbitmqctl_check_formatted.bzl", "rabbitmqctl_check_formatted_test")
load(":rabbitmqctl_test.bzl", "rabbitmqctl_test")
load("//:rabbitmq_home.bzl", "rabbitmq_home")
load("//:rabbitmq_run.bzl", "rabbitmq_run")
load("//:rabbitmq.bzl", "RABBITMQ_DIALYZER_OPTS", "STARTS_BACKGROUND_BROKER_TAG", "without")
# Note: All the various rabbitmq-* scripts are just copies of rabbitmqctl
rabbitmqctl(
name = "rabbitmqctl",
srcs = [
"mix.exs",
"config/config.exs",
] + glob([
"lib/**/*.ex",
]),
license_files = glob(["LICENSE*"]),
visibility = ["//visibility:public"],
deps = [
"//deps/rabbit_common:erlang_app",
"@observer_cli//:erlang_app",
"@stdout_formatter//:erlang_app",
],
archives = [
"@hex//:archive",
],
source_deps = {
"@csv//:sources": "csv",
"@json//:sources": "json",
"@parallel_stream//:sources": "parallel_stream", # transitive dep of csv 2.x
},
)
rabbitmq_home(
name = "broker-for-cli-tests-home",
testonly = True,
plugins = [
"//deps/rabbit:erlang_app",
"//deps/rabbitmq_federation:erlang_app",
"//deps/rabbitmq_stomp:erlang_app",
"//deps/rabbitmq_stream_management:erlang_app",
"//deps/amqp_client:erlang_app",
],
)
rabbitmq_run(
name = "rabbitmq-for-cli-tests-run",
testonly = True,
home = ":broker-for-cli-tests-home",
visibility = ["//visibility:public"],
)
rabbitmqctl_check_formatted_test(
name = "check_formatted",
size = "small",
srcs = [
"mix.exs",
"config/config.exs",
".formatter.exs",
] + glob([
"lib/**/*.ex",
"test/**/*.exs",
]),
data = glob(["test/fixtures/**/*"]),
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//os:macos"],
"//conditions:default": ["@platforms//os:linux"],
}),
)
test_suite(
name = "rabbitmqctl_check_formatted",
tests = ["check_formatted"],
)
plt(
name = "deps_plt",
apps = [
"kernel",
"stdlib",
"erts",
"mnesia",
"public_key",
"runtime_tools",
],
libs = [":elixir"],
deps = [
":elixir",
"//deps/rabbit:erlang_app",
"//deps/rabbit_common:erlang_app",
],
ignore_warnings = True,
)
dialyze(
dialyzer_opts = without(
# Some Elixir.CSV, Elixir.JSON and Elixir.Logger functions are unknown
"-Wunknown",
RABBITMQ_DIALYZER_OPTS,
),
libs = [":elixir"],
plt = ":deps_plt",
)
rabbitmqctl_test(
name = "tests",
size = "large",
srcs = [
"mix.exs",
"config/config.exs",
".formatter.exs",
] + glob([
"lib/**/*.ex",
"test/**/*.exs",
]),
data = glob(["test/fixtures/**/*"]),
flaky = True,
rabbitmq_run = ":rabbitmq-for-cli-tests-run",
tags = [STARTS_BACKGROUND_BROKER_TAG],
deps = [
"//deps/amqp_client:erlang_app",
"//deps/rabbit:erlang_app",
"//deps/rabbit_common:erlang_app",
"@observer_cli//:erlang_app",
"@stdout_formatter//:erlang_app",
],
archives = [
"@hex//:archive",
],
source_deps = {
"@amqp//:sources": "amqp",
"@csv//:sources": "csv",
"@dialyxir//:sources": "dialyxir",
"@json//:sources": "json",
"@parallel_stream//:sources": "parallel_stream", # transitive dep of csv 2.x
"@temp//:sources": "temp",
"@x509//:sources": "x509",
},
)
test_suite(
name = "rabbitmqctl_tests",
tests = ["tests"],
)