diff options
author | Rin Kuryloski <kuryloskip@vmware.com> | 2023-02-23 14:47:41 +0100 |
---|---|---|
committer | Rin Kuryloski <kuryloskip@vmware.com> | 2023-04-17 18:13:18 +0200 |
commit | 8de8f59d47ef00c077ec53ad7a0ee5610cfdf746 (patch) | |
tree | 5d57b0089aca4fe7316a5ba6ef62648e8c715303 /deps/rabbit | |
parent | e50746938704dca0400528a89f0e05bf08b6d7f5 (diff) | |
download | rabbitmq-server-git-8de8f59d47ef00c077ec53ad7a0ee5610cfdf746.tar.gz |
Use gazelle generated bazel files
Bazel build files are now maintained primarily with `bazel run
gazelle`. This will analyze and merge changes into the build files as
necessitated by certain code changes (e.g. the introduction of new
modules).
In some cases there hints to gazelle in the build files, such as `#
gazelle:erlang...` or `# keep` comments. xref checks on plugins that
depend on the cli are a good example.
Diffstat (limited to 'deps/rabbit')
-rw-r--r-- | deps/rabbit/BUILD.bazel | 362 | ||||
-rw-r--r-- | deps/rabbit/app.bzl | 1209 | ||||
-rw-r--r-- | deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel | 92 | ||||
-rw-r--r-- | deps/rabbit/apps/rabbitmq_prelaunch/app.bzl | 84 | ||||
-rw-r--r-- | deps/rabbit/test/dummy_runtime_parameters.erl | 2 | ||||
-rw-r--r-- | deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel | 116 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_fifo_SUITE.erl | 2 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_fifo_dlx_SUITE.erl | 4 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_fifo_prop_SUITE.erl | 4 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_fifo_v0_SUITE.erl | 2 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_stream_coordinator_SUITE.erl | 2 | ||||
-rw-r--r-- | deps/rabbit/test/rabbit_stream_sac_coordinator_SUITE.erl | 2 |
12 files changed, 1647 insertions, 234 deletions
diff --git a/deps/rabbit/BUILD.bazel b/deps/rabbit/BUILD.bazel index 90610d3405..59c4c37ae5 100644 --- a/deps/rabbit/BUILD.bazel +++ b/deps/rabbit/BUILD.bazel @@ -1,3 +1,4 @@ +load("@rules_erlang//:eunit2.bzl", "eunit") load("@rules_erlang//:xref2.bzl", "xref") load("@rules_erlang//:dialyze.bzl", "dialyze", "plt") load("//:rabbitmq_home.bzl", "rabbitmq_home") @@ -9,9 +10,15 @@ load( "rabbitmq_app", "rabbitmq_integration_suite", "rabbitmq_suite", - "rabbitmq_test_helper", "without", ) +load( + ":app.bzl", + "all_beam_files", + "all_srcs", + "all_test_beam_files", + "test_suite_beam_files", +) load(":bats.bzl", "bats") exports_files(glob([ @@ -142,27 +149,6 @@ _APP_ENV = """[ ] """ -DEPS = [ - "//deps/amqp10_common:erlang_app", - "//deps/rabbit_common:erlang_app", - "@cuttlefish//:erlang_app", - "@ra//:erlang_app", - "@ranch//:erlang_app", - "@stdout_formatter//:erlang_app", - "@syslog//:erlang_app", -] - -RUNTIME_DEPS = [ - "//deps/rabbit/apps/rabbitmq_prelaunch:erlang_app", - "@observer_cli//:erlang_app", - "@osiris//:erlang_app", - "@recon//:erlang_app", - "@redbug//:erlang_app", - "@seshat//:erlang_app", - "@sysmon_handler//:erlang_app", - "@systemd//:erlang_app", -] - APP_MODULE = "rabbit" APP_REGISTERED = [ @@ -173,51 +159,96 @@ APP_REGISTERED = [ "rabbit_router", ] -EXTRA_APPS = [ - "sasl", - "rabbitmq_prelaunch", - "os_mon", - "inets", - "compiler", - "public_key", - "crypto", - "ssl", - "syntax_tools", - "xmerl", -] +all_beam_files(name = "all_beam_files") + +all_test_beam_files(name = "all_test_beam_files") + +all_srcs(name = "all_srcs") + +test_suite_beam_files(name = "test_suite_beam_files") + +# gazelle:erlang_apps_dirs apps + +# gazelle:erlang_app_extra_app sasl +# gazelle:erlang_app_extra_app os_mon +# gazelle:erlang_app_extra_app inets +# gazelle:erlang_app_extra_app compiler +# gazelle:erlang_app_extra_app crypto +# gazelle:erlang_app_extra_app public_key +# gazelle:erlang_app_extra_app ssl +# gazelle:erlang_app_extra_app syntax_tools +# gazelle:erlang_app_extra_app xmerl + +# gazelle:erlang_app_dep cuttlefish +# gazelle:erlang_app_dep syslog +# gazelle:erlang_app_dep observer_cli +# gazelle:erlang_app_dep redbug +# gazelle:erlang_app_dep sysmon_handler +# gazelle:erlang_app_dep systemd rabbitmq_app( + name = "erlang_app", + srcs = [":all_srcs"], + hdrs = [":public_hdrs"], app_description = "RabbitMQ", app_env = _APP_ENV, app_module = APP_MODULE, app_name = "rabbit", app_registered = APP_REGISTERED, - extra_apps = EXTRA_APPS, - runtime_deps = RUNTIME_DEPS, - deps = DEPS, + beam_files = [":beam_files"], + extra_apps = [ + "compiler", + "inets", + "os_mon", + "public_key", + "sasl", + "ssl", + "syntax_tools", + "xmerl", + "crypto", + ], + license_files = [":license_files"], + priv = [":priv"], + deps = [ + "//deps/amqp10_common:erlang_app", + "//deps/rabbit/apps/rabbitmq_prelaunch:erlang_app", + "//deps/rabbit_common:erlang_app", + "@cuttlefish//:erlang_app", + "@observer_cli//:erlang_app", + "@osiris//:erlang_app", + "@ra//:erlang_app", + "@ranch//:erlang_app", + "@recon//:erlang_app", + "@redbug//:erlang_app", + "@seshat//:erlang_app", + "@stdout_formatter//:erlang_app", + "@syslog//:erlang_app", + "@sysmon_handler//:erlang_app", + "@systemd//:erlang_app", + ], ) -xref() - -plt_apps = [ - "mnesia", - "runtime_tools", -] + EXTRA_APPS - -plt_apps.remove("rabbitmq_prelaunch") +xref( + name = "xref", + target = ":erlang_app", +) plt( - name = "base_plt", - apps = plt_apps, - plt = "//:base_plt", - deps = DEPS + RUNTIME_DEPS, + name = "deps_plt", + apps = [ + "mnesia", # keep + ], + for_target = ":erlang_app", ignore_warnings = True, + plt = "//:base_plt", ) dialyze( + name = "dialyze", # A few `lg` functions are unknown dialyzer_opts = without("-Wunknown", RABBITMQ_DIALYZER_OPTS), - plt = ":base_plt", + plt = ":deps_plt", + target = ":erlang_app", ) bats( @@ -246,42 +277,6 @@ rabbitmq_run( home = ":broker-for-tests-home", ) -rabbitmq_test_helper( - name = "quorum_queue_utils", - srcs = [ - "test/quorum_queue_utils.erl", - ], -) - -rabbitmq_test_helper( - name = "rabbit_ha_test_consumer", - srcs = [ - "test/rabbit_ha_test_consumer.erl", - ], - deps = [ - "//deps/amqp_client:erlang_app", - "//deps/rabbit_common:erlang_app", - ], -) - -rabbitmq_test_helper( - name = "rabbit_ha_test_producer", - srcs = [ - "test/rabbit_ha_test_producer.erl", - ], - deps = [ - "//deps/amqp_client:erlang_app", - "//deps/rabbit_common:erlang_app", - ], -) - -rabbitmq_test_helper( - name = "test_util", - srcs = [ - "test/test_util.erl", - ], -) - rabbitmq_suite( name = "amqqueue_backward_compatibility_SUITE", size = "small", @@ -295,17 +290,17 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "channel_interceptor_SUITE", size = "medium", - additional_srcs = [ - "test/dummy_interceptor.erl", - "test/failing_dummy_interceptor.erl", + additional_beam = [ + "test/dummy_interceptor.beam", + "test/failing_dummy_interceptor.beam", ], ) rabbitmq_integration_suite( name = "channel_operation_timeout_SUITE", size = "medium", - additional_srcs = [ - "test/channel_operation_timeout_test_queue.erl", + additional_beam = [ + "test/channel_operation_timeout_test_queue.beam", ], ) @@ -356,7 +351,7 @@ rabbitmq_integration_suite( name = "consumer_timeout_SUITE", size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) @@ -369,7 +364,7 @@ rabbitmq_integration_suite( name = "dead_lettering_SUITE", size = "large", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], flaky = True, shard_count = 7, @@ -405,7 +400,7 @@ rabbitmq_integration_suite( name = "dynamic_qq_SUITE", size = "large", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], flaky = True, deps = [ @@ -490,7 +485,7 @@ rabbitmq_integration_suite( name = "maintenance_mode_SUITE", size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) @@ -498,8 +493,8 @@ rabbitmq_integration_suite( name = "many_node_ha_SUITE", size = "medium", additional_beam = [ - ":rabbit_ha_test_consumer", - ":rabbit_ha_test_producer", + ":test_rabbit_ha_test_consumer_beam", + ":test_rabbit_ha_test_producer_beam", ], ) @@ -524,8 +519,8 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "mirrored_supervisor_SUITE", size = "small", - additional_srcs = [ - "test/mirrored_supervisor_SUITE_gs.erl", + additional_beam = [ + "test/mirrored_supervisor_SUITE_gs.beam", ], ) @@ -619,7 +614,7 @@ rabbitmq_integration_suite( name = "publisher_confirms_parallel_SUITE", size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) @@ -638,7 +633,7 @@ rabbitmq_integration_suite( name = "queue_parallel_SUITE", size = "large", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], flaky = True, shard_count = 6, @@ -653,7 +648,7 @@ rabbitmq_integration_suite( name = "quorum_queue_SUITE", size = "large", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], flaky = True, shard_count = 6, @@ -673,48 +668,37 @@ rabbitmq_integration_suite( ) rabbitmq_suite( + name = "rabbit_cuttlefish_SUITE", +) + +rabbitmq_suite( name = "rabbit_fifo_int_SUITE", size = "medium", - runtime_deps = [ + deps = [ + "//deps/rabbit_common:erlang_app", "@aten//:erlang_app", "@gen_batch_server//:erlang_app", "@meck//:erlang_app", "@ra//:erlang_app", ], - deps = [ - "//deps/rabbit_common:erlang_app", - ], ) rabbitmq_suite( name = "rabbit_fifo_prop_SUITE", size = "large", additional_beam = [ - ":test_util", - ], - additional_hdrs = [ - "src/rabbit_fifo.hrl", - ], - erlc_opts = [ - "-I", - "deps/rabbit", # allow rabbit_fifo.hrl to be included at src/rabbit_fifo.hrl - ], - runtime_deps = [ - "@ra//:erlang_app", + ":test_test_util_beam", ], deps = [ "//deps/rabbit_common:erlang_app", "@proper//:erlang_app", + "@ra//:erlang_app", ], ) rabbitmq_suite( name = "rabbit_fifo_dlx_SUITE", size = "small", - additional_hdrs = [ - "src/rabbit_fifo.hrl", - "src/rabbit_fifo_dlx.hrl", - ], deps = [ "//deps/rabbit_common:erlang_app", ], @@ -724,19 +708,13 @@ rabbitmq_integration_suite( name = "rabbit_fifo_dlx_integration_SUITE", size = "medium", additional_beam = [ - ":test_util", - ":quorum_queue_utils", + ":test_test_util_beam", + ":test_quorum_queue_utils_beam", ":quorum_queue_SUITE_beam_files", ], - additional_hdrs = [ - "src/rabbit_fifo.hrl", - "src/rabbit_fifo_dlx.hrl", - ], - runtime_deps = [ - "@ra//:erlang_app", - ], deps = [ "@proper//:erlang_app", + "@ra//:erlang_app", ], ) @@ -744,18 +722,13 @@ rabbitmq_suite( name = "rabbit_fifo_SUITE", size = "medium", additional_beam = [ - ":test_util", + ":test_test_util_beam", ":rabbit_fifo_v0_SUITE_beam_files", ], - additional_hdrs = [ - "src/rabbit_fifo.hrl", - ], - runtime_deps = [ - "@meck//:erlang_app", - "@ra//:erlang_app", - ], deps = [ "//deps/rabbit_common:erlang_app", + "@meck//:erlang_app", + "@ra//:erlang_app", ], ) @@ -763,21 +736,12 @@ rabbitmq_suite( name = "rabbit_fifo_v0_SUITE", size = "medium", additional_beam = [ - ":test_util", - ], - additional_hdrs = [ - "src/rabbit_fifo_v0.hrl", - ], - erlc_opts = [ - "-I", - "deps/rabbit", # allow rabbit_fifo.hrl to be included at src/rabbit_fifo.hrl - ], - runtime_deps = [ - "@meck//:erlang_app", - "@ra//:erlang_app", + ":test_test_util_beam", ], deps = [ "//deps/rabbit_common:erlang_app", + "@meck//:erlang_app", + "@ra//:erlang_app", ], ) @@ -811,7 +775,7 @@ rabbitmq_integration_suite( name = "rabbit_stream_queue_SUITE", size = "large", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], flaky = True, shard_count = 12, @@ -845,8 +809,8 @@ rabbitmq_integration_suite( name = "simple_ha_SUITE", size = "large", additional_beam = [ - ":rabbit_ha_test_consumer", - ":rabbit_ha_test_producer", + ":test_rabbit_ha_test_consumer_beam", + ":test_rabbit_ha_test_producer_beam", ], shard_count = 4, ) @@ -855,7 +819,7 @@ rabbitmq_integration_suite( name = "single_active_consumer_SUITE", size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) @@ -879,9 +843,9 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "unit_access_control_authn_authz_context_propagation_SUITE", size = "medium", - additional_srcs = [ - "test/rabbit_auth_backend_context_propagation_mock.erl", - "test/rabbit_foo_protocol_connection_info.erl", + additional_beam = [ + "test/rabbit_auth_backend_context_propagation_mock.beam", + "test/rabbit_foo_protocol_connection_info.beam", ], ) @@ -896,8 +860,8 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "unit_access_control_SUITE", size = "medium", - additional_srcs = [ - "test/rabbit_dummy_protocol_connection_info.erl", + additional_beam = [ + "test/rabbit_dummy_protocol_connection_info.beam", ], ) @@ -922,7 +886,7 @@ rabbitmq_integration_suite( rabbitmq_suite( name = "unit_cluster_formation_locking_mocks_SUITE", size = "small", - runtime_deps = [ + deps = [ "@meck//:erlang_app", ], ) @@ -930,7 +894,7 @@ rabbitmq_suite( rabbitmq_suite( name = "unit_collections_SUITE", size = "small", - runtime_deps = [ + deps = [ "//deps/rabbit_common:erlang_app", ], ) @@ -938,7 +902,7 @@ rabbitmq_suite( rabbitmq_suite( name = "unit_config_value_encryption_SUITE", size = "medium", - runtime_deps = [ + deps = [ "//deps/rabbit/apps/rabbitmq_prelaunch:test_erlang_app", "//deps/rabbit_common:test_erlang_app", "@credentials_obfuscation//:erlang_app", @@ -973,7 +937,7 @@ rabbitmq_integration_suite( rabbitmq_suite( name = "unit_gm_SUITE", size = "small", - runtime_deps = [ + deps = [ "//deps/rabbitmq_ct_helpers:erlang_app", "@meck//:erlang_app", ], @@ -1028,16 +992,16 @@ rabbitmq_suite( rabbitmq_integration_suite( name = "unit_stats_and_metrics_SUITE", size = "medium", - additional_srcs = [ - "test/dummy_event_receiver.erl", + additional_beam = [ + "test/dummy_event_receiver.beam", ], ) rabbitmq_suite( name = "unit_supervisor2_SUITE", size = "small", - additional_srcs = [ - "test/dummy_supervisor2.erl", + additional_beam = [ + "test/dummy_supervisor2.beam", ], ) @@ -1054,8 +1018,8 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "vhost_SUITE", size = "medium", - additional_srcs = [ - "test/test_rabbit_event_handler.erl", + additional_beam = [ + "test/test_rabbit_event_handler.beam", ], flaky = True, ) @@ -1076,25 +1040,17 @@ rabbitmq_suite( ], ) -rabbitmq_suite( - name = "rabbit_cuttlefish_SUITE", - size = "small", - deps = [ - "@cuttlefish//:erlang_app", - ], -) - rabbitmq_integration_suite( name = "direct_exchange_routing_v2_SUITE", size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) rabbitmq_integration_suite( name = "rabbit_direct_reply_to_prop_SUITE", - size = "small", + size = "medium", deps = [ "@proper//:erlang_app", ], @@ -1102,14 +1058,14 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "unicode_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "exchanges_SUITE", - size = "small", + size = "medium", additional_beam = [ - ":quorum_queue_utils", + ":test_quorum_queue_utils_beam", ], ) @@ -1120,37 +1076,37 @@ rabbitmq_integration_suite( rabbitmq_integration_suite( name = "rabbit_db_queue_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_maintenance_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_topic_exchange_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_exchange_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_binding_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_msup_SUITE", - size = "small", + size = "medium", ) rabbitmq_integration_suite( name = "rabbit_db_policy_SUITE", - size = "small", + size = "medium", ) assert_suites() @@ -1223,3 +1179,31 @@ rm -dr web-manpages-tmp """, visibility = ["//visibility:public"], ) + +alias( + name = "rabbit", + actual = ":erlang_app", + visibility = ["//visibility:public"], +) + +eunit( + name = "eunit", + compiled_suites = [ + ":test_channel_operation_timeout_test_queue_beam", + ":test_dummy_event_receiver_beam", + ":test_dummy_interceptor_beam", + ":test_dummy_runtime_parameters_beam", + ":test_dummy_supervisor2_beam", + ":test_failing_dummy_interceptor_beam", + ":test_mirrored_supervisor_SUITE_gs_beam", + ":test_quorum_queue_utils_beam", + ":test_rabbit_auth_backend_context_propagation_mock_beam", + ":test_rabbit_dummy_protocol_connection_info_beam", + ":test_rabbit_foo_protocol_connection_info_beam", + ":test_rabbit_ha_test_consumer_beam", + ":test_rabbit_ha_test_producer_beam", + ":test_test_util_beam", + ":test_test_rabbit_event_handler_beam", + ], + target = ":test_erlang_app", +) diff --git a/deps/rabbit/app.bzl b/deps/rabbit/app.bzl new file mode 100644 index 0000000000..80efffd73d --- /dev/null +++ b/deps/rabbit/app.bzl @@ -0,0 +1,1209 @@ +load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode") +load("@rules_erlang//:filegroup.bzl", "filegroup") + +def all_beam_files(name = "all_beam_files"): + filegroup( + name = "beam_files", + srcs = [":behaviours", ":other_beam"], + ) + erlang_bytecode( + name = "behaviours", + srcs = [ + "src/gm.erl", + "src/rabbit_backing_queue.erl", + "src/rabbit_credential_validator.erl", + "src/rabbit_exchange_type.erl", + "src/rabbit_mirror_queue_mode.erl", + "src/rabbit_policy_merge_strategy.erl", + "src/rabbit_queue_master_locator.erl", + "src/rabbit_queue_type.erl", + "src/rabbit_tracking.erl", + ], + hdrs = [":public_and_private_hdrs"], + app_name = "rabbit", + dest = "ebin", + erlc_opts = "//:erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "other_beam", + srcs = native.glob( + ["src/**/*.erl"], + exclude = [ + "src/gm.erl", + "src/rabbit_backing_queue.erl", + "src/rabbit_credential_validator.erl", + "src/rabbit_exchange_type.erl", + "src/rabbit_mirror_queue_mode.erl", + "src/rabbit_policy_merge_strategy.erl", + "src/rabbit_queue_master_locator.erl", + "src/rabbit_queue_type.erl", + "src/rabbit_tracking.erl", + ], + ), + hdrs = [":public_and_private_hdrs"], + app_name = "rabbit", + beam = [":behaviours"], + dest = "ebin", + erlc_opts = "//:erlc_opts", + deps = [ + "//deps/amqp10_common:erlang_app", + "//deps/rabbit_common:erlang_app", + "@ra//:erlang_app", + "@ranch//:erlang_app", + "@stdout_formatter//:erlang_app", + ], + ) + +def all_test_beam_files(name = "all_test_beam_files"): + filegroup( + name = "test_beam_files", + testonly = True, + srcs = [":test_behaviours", ":test_other_beam"], + ) + erlang_bytecode( + name = "test_behaviours", + testonly = True, + srcs = [ + "src/gm.erl", + "src/rabbit_backing_queue.erl", + "src/rabbit_credential_validator.erl", + "src/rabbit_exchange_type.erl", + "src/rabbit_mirror_queue_mode.erl", + "src/rabbit_policy_merge_strategy.erl", + "src/rabbit_queue_master_locator.erl", + "src/rabbit_queue_type.erl", + "src/rabbit_tracking.erl", + ], + hdrs = [":public_and_private_hdrs"], + app_name = "rabbit", + dest = "test", + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_other_beam", + testonly = True, + srcs = native.glob( + ["src/**/*.erl"], + exclude = [ + "src/gm.erl", + "src/rabbit_backing_queue.erl", + "src/rabbit_credential_validator.erl", + "src/rabbit_exchange_type.erl", + "src/rabbit_mirror_queue_mode.erl", + "src/rabbit_policy_merge_strategy.erl", + "src/rabbit_queue_master_locator.erl", + "src/rabbit_queue_type.erl", + "src/rabbit_tracking.erl", + ], + ), + hdrs = [":public_and_private_hdrs"], + app_name = "rabbit", + beam = [":test_behaviours"], + dest = "test", + erlc_opts = "//:test_erlc_opts", + deps = [ + "//deps/amqp10_common:erlang_app", + "//deps/rabbit_common:erlang_app", + "@ra//:erlang_app", + "@ranch//:erlang_app", + "@stdout_formatter//:erlang_app", + ], + ) + +def all_srcs(name = "all_srcs"): + filegroup( + name = "all_srcs", + srcs = [":public_and_private_hdrs", ":srcs"], + ) + filegroup( + name = "public_and_private_hdrs", + srcs = [":private_hdrs", ":public_hdrs"], + ) + filegroup( + name = "public_hdrs", + srcs = native.glob(["include/**/*.hrl"]), + ) + + filegroup( + name = "priv", + srcs = native.glob(["priv/**/*"]), + ) + filegroup( + name = "private_hdrs", + srcs = native.glob(["src/**/*.hrl"]), + ) + filegroup( + name = "srcs", + srcs = native.glob([ + "src/**/*.app.src", + "src/**/*.erl", + ]), + ) + filegroup( + name = "license_files", + srcs = native.glob(["LICENSE*"]), + ) + +def test_suite_beam_files(name = "test_suite_beam_files"): + erlang_bytecode( + name = "amqqueue_backward_compatibility_SUITE_beam_files", + testonly = True, + srcs = ["test/amqqueue_backward_compatibility_SUITE.erl"], + outs = ["test/amqqueue_backward_compatibility_SUITE.beam"], + hdrs = ["include/amqqueue.hrl", "include/amqqueue_v2.hrl"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "backing_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/backing_queue_SUITE.erl"], + outs = ["test/backing_queue_SUITE.beam"], + hdrs = ["include/amqqueue.hrl", "include/amqqueue_v2.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "channel_interceptor_SUITE_beam_files", + testonly = True, + srcs = ["test/channel_interceptor_SUITE.erl"], + outs = ["test/channel_interceptor_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "channel_operation_timeout_SUITE_beam_files", + testonly = True, + srcs = ["test/channel_operation_timeout_SUITE.erl"], + outs = ["test/channel_operation_timeout_SUITE.beam"], + hdrs = ["include/amqqueue.hrl", "include/amqqueue_v2.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "classic_queue_prop_SUITE_beam_files", + testonly = True, + srcs = ["test/classic_queue_prop_SUITE.erl"], + outs = ["test/classic_queue_prop_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "cluster_SUITE_beam_files", + testonly = True, + srcs = ["test/cluster_SUITE.erl"], + outs = ["test/cluster_SUITE.beam"], + hdrs = ["include/amqqueue.hrl", "include/amqqueue_v2.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "cluster_rename_SUITE_beam_files", + testonly = True, + srcs = ["test/cluster_rename_SUITE.erl"], + outs = ["test/cluster_rename_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "clustering_management_SUITE_beam_files", + testonly = True, + srcs = ["test/clustering_management_SUITE.erl"], + outs = ["test/clustering_management_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "config_schema_SUITE_beam_files", + testonly = True, + srcs = ["test/config_schema_SUITE.erl"], + outs = ["test/config_schema_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "confirms_rejects_SUITE_beam_files", + testonly = True, + srcs = ["test/confirms_rejects_SUITE.erl"], + outs = ["test/confirms_rejects_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "consumer_timeout_SUITE_beam_files", + testonly = True, + srcs = ["test/consumer_timeout_SUITE.erl"], + outs = ["test/consumer_timeout_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "crashing_queues_SUITE_beam_files", + testonly = True, + srcs = ["test/crashing_queues_SUITE.erl"], + outs = ["test/crashing_queues_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "dead_lettering_SUITE_beam_files", + testonly = True, + srcs = ["test/dead_lettering_SUITE.erl"], + outs = ["test/dead_lettering_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "definition_import_SUITE_beam_files", + testonly = True, + srcs = ["test/definition_import_SUITE.erl"], + outs = ["test/definition_import_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "direct_exchange_routing_v2_SUITE_beam_files", + testonly = True, + srcs = ["test/direct_exchange_routing_v2_SUITE.erl"], + outs = ["test/direct_exchange_routing_v2_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "disconnect_detected_during_alarm_SUITE_beam_files", + testonly = True, + srcs = ["test/disconnect_detected_during_alarm_SUITE.erl"], + outs = ["test/disconnect_detected_during_alarm_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "disk_monitor_SUITE_beam_files", + testonly = True, + srcs = ["test/disk_monitor_SUITE.erl"], + outs = ["test/disk_monitor_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "dynamic_ha_SUITE_beam_files", + testonly = True, + srcs = ["test/dynamic_ha_SUITE.erl"], + outs = ["test/dynamic_ha_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "dynamic_qq_SUITE_beam_files", + testonly = True, + srcs = ["test/dynamic_qq_SUITE.erl"], + outs = ["test/dynamic_qq_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "eager_sync_SUITE_beam_files", + testonly = True, + srcs = ["test/eager_sync_SUITE.erl"], + outs = ["test/eager_sync_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "feature_flags_SUITE_beam_files", + testonly = True, + srcs = ["test/feature_flags_SUITE.erl"], + outs = ["test/feature_flags_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "feature_flags_v2_SUITE_beam_files", + testonly = True, + srcs = ["test/feature_flags_v2_SUITE.erl"], + outs = ["test/feature_flags_v2_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "feature_flags_with_unpriveleged_user_SUITE_beam_files", + testonly = True, + srcs = ["test/feature_flags_with_unpriveleged_user_SUITE.erl"], + outs = ["test/feature_flags_with_unpriveleged_user_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "lazy_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/lazy_queue_SUITE.erl"], + outs = ["test/lazy_queue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "list_consumers_sanity_check_SUITE_beam_files", + testonly = True, + srcs = ["test/list_consumers_sanity_check_SUITE.erl"], + outs = ["test/list_consumers_sanity_check_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "list_queues_online_and_offline_SUITE_beam_files", + testonly = True, + srcs = ["test/list_queues_online_and_offline_SUITE.erl"], + outs = ["test/list_queues_online_and_offline_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "logging_SUITE_beam_files", + testonly = True, + srcs = ["test/logging_SUITE.erl"], + outs = ["test/logging_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "lqueue_SUITE_beam_files", + testonly = True, + srcs = ["test/lqueue_SUITE.erl"], + outs = ["test/lqueue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["@proper//:erlang_app"], + ) + erlang_bytecode( + name = "maintenance_mode_SUITE_beam_files", + testonly = True, + srcs = ["test/maintenance_mode_SUITE.erl"], + outs = ["test/maintenance_mode_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "many_node_ha_SUITE_beam_files", + testonly = True, + srcs = ["test/many_node_ha_SUITE.erl"], + outs = ["test/many_node_ha_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "message_size_limit_SUITE_beam_files", + testonly = True, + srcs = ["test/message_size_limit_SUITE.erl"], + outs = ["test/message_size_limit_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "metrics_SUITE_beam_files", + testonly = True, + srcs = ["test/metrics_SUITE.erl"], + outs = ["test/metrics_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbit_common:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "mirrored_supervisor_SUITE_beam_files", + testonly = True, + srcs = ["test/mirrored_supervisor_SUITE.erl"], + outs = ["test/mirrored_supervisor_SUITE.beam"], + beam = ["ebin/mirrored_supervisor.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "msg_store_SUITE_beam_files", + testonly = True, + srcs = ["test/msg_store_SUITE.erl"], + outs = ["test/msg_store_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "peer_discovery_classic_config_SUITE_beam_files", + testonly = True, + srcs = ["test/peer_discovery_classic_config_SUITE.erl"], + outs = ["test/peer_discovery_classic_config_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "peer_discovery_dns_SUITE_beam_files", + testonly = True, + srcs = ["test/peer_discovery_dns_SUITE.erl"], + outs = ["test/peer_discovery_dns_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "per_user_connection_channel_limit_SUITE_beam_files", + testonly = True, + srcs = ["test/per_user_connection_channel_limit_SUITE.erl"], + outs = ["test/per_user_connection_channel_limit_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "per_user_connection_channel_limit_partitions_SUITE_beam_files", + testonly = True, + srcs = ["test/per_user_connection_channel_limit_partitions_SUITE.erl"], + outs = ["test/per_user_connection_channel_limit_partitions_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "per_user_connection_channel_tracking_SUITE_beam_files", + testonly = True, + srcs = ["test/per_user_connection_channel_tracking_SUITE.erl"], + outs = ["test/per_user_connection_channel_tracking_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "per_user_connection_tracking_SUITE_beam_files", + testonly = True, + srcs = ["test/per_user_connection_tracking_SUITE.erl"], + outs = ["test/per_user_connection_tracking_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "per_vhost_connection_limit_SUITE_beam_files", + testonly = True, + srcs = ["test/per_vhost_connection_limit_SUITE.erl"], + outs = ["test/per_vhost_connection_limit_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "per_vhost_connection_limit_partitions_SUITE_beam_files", + testonly = True, + srcs = ["test/per_vhost_connection_limit_partitions_SUITE.erl"], + outs = ["test/per_vhost_connection_limit_partitions_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "per_vhost_msg_store_SUITE_beam_files", + testonly = True, + srcs = ["test/per_vhost_msg_store_SUITE.erl"], + outs = ["test/per_vhost_msg_store_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "per_vhost_queue_limit_SUITE_beam_files", + testonly = True, + srcs = ["test/per_vhost_queue_limit_SUITE.erl"], + outs = ["test/per_vhost_queue_limit_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "policy_SUITE_beam_files", + testonly = True, + srcs = ["test/policy_SUITE.erl"], + outs = ["test/policy_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "priority_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/priority_queue_SUITE.erl"], + outs = ["test/priority_queue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "priority_queue_recovery_SUITE_beam_files", + testonly = True, + srcs = ["test/priority_queue_recovery_SUITE.erl"], + outs = ["test/priority_queue_recovery_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "product_info_SUITE_beam_files", + testonly = True, + srcs = ["test/product_info_SUITE.erl"], + outs = ["test/product_info_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "proxy_protocol_SUITE_beam_files", + testonly = True, + srcs = ["test/proxy_protocol_SUITE.erl"], + outs = ["test/proxy_protocol_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "publisher_confirms_parallel_SUITE_beam_files", + testonly = True, + srcs = ["test/publisher_confirms_parallel_SUITE.erl"], + outs = ["test/publisher_confirms_parallel_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "queue_length_limits_SUITE_beam_files", + testonly = True, + srcs = ["test/queue_length_limits_SUITE.erl"], + outs = ["test/queue_length_limits_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "queue_master_location_SUITE_beam_files", + testonly = True, + srcs = ["test/queue_master_location_SUITE.erl"], + outs = ["test/queue_master_location_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "queue_parallel_SUITE_beam_files", + testonly = True, + srcs = ["test/queue_parallel_SUITE.erl"], + outs = ["test/queue_parallel_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "queue_type_SUITE_beam_files", + testonly = True, + srcs = ["test/queue_type_SUITE.erl"], + outs = ["test/queue_type_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "quorum_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/quorum_queue_SUITE.erl"], + outs = ["test/quorum_queue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_confirms_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_confirms_SUITE.erl"], + outs = ["test/rabbit_confirms_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "rabbit_core_metrics_gc_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_core_metrics_gc_SUITE.erl"], + outs = ["test/rabbit_core_metrics_gc_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_direct_reply_to_prop_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_direct_reply_to_prop_SUITE.erl"], + outs = ["test/rabbit_direct_reply_to_prop_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["@proper//:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_SUITE.erl"], + outs = ["test/rabbit_fifo_SUITE.beam"], + hdrs = ["src/rabbit_fifo.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_dlx_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_dlx_SUITE.erl"], + outs = ["test/rabbit_fifo_dlx_SUITE.beam"], + hdrs = ["src/rabbit_fifo.hrl", "src/rabbit_fifo_dlx.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_dlx_integration_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_dlx_integration_SUITE.erl"], + outs = ["test/rabbit_fifo_dlx_integration_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_int_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_int_SUITE.erl"], + outs = ["test/rabbit_fifo_int_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_prop_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_prop_SUITE.erl"], + outs = ["test/rabbit_fifo_prop_SUITE.beam"], + hdrs = ["src/rabbit_fifo.hrl", "src/rabbit_fifo_dlx.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_fifo_v0_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_fifo_v0_SUITE.erl"], + outs = ["test/rabbit_fifo_v0_SUITE.beam"], + hdrs = ["src/rabbit_fifo_v0.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_msg_record_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_msg_record_SUITE.erl"], + outs = ["test/rabbit_msg_record_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp10_common:erlang_app", "//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_stream_coordinator_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_stream_coordinator_SUITE.erl"], + outs = ["test/rabbit_stream_coordinator_SUITE.beam"], + hdrs = ["src/rabbit_stream_coordinator.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_stream_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_stream_queue_SUITE.erl"], + outs = ["test/rabbit_stream_queue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_stream_sac_coordinator_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_stream_sac_coordinator_SUITE.erl"], + outs = ["test/rabbit_stream_sac_coordinator_SUITE.beam"], + hdrs = ["src/rabbit_stream_sac_coordinator.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit:erlang_app"], + ) + erlang_bytecode( + name = "rabbitmq_queues_cli_integration_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbitmq_queues_cli_integration_SUITE.erl"], + outs = ["test/rabbitmq_queues_cli_integration_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "rabbitmqctl_integration_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbitmqctl_integration_SUITE.erl"], + outs = ["test/rabbitmqctl_integration_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "rabbitmqctl_shutdown_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbitmqctl_shutdown_SUITE.erl"], + outs = ["test/rabbitmqctl_shutdown_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "signal_handling_SUITE_beam_files", + testonly = True, + srcs = ["test/signal_handling_SUITE.erl"], + outs = ["test/signal_handling_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "simple_ha_SUITE_beam_files", + testonly = True, + srcs = ["test/simple_ha_SUITE.erl"], + outs = ["test/simple_ha_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "single_active_consumer_SUITE_beam_files", + testonly = True, + srcs = ["test/single_active_consumer_SUITE.erl"], + outs = ["test/single_active_consumer_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "sync_detection_SUITE_beam_files", + testonly = True, + srcs = ["test/sync_detection_SUITE.erl"], + outs = ["test/sync_detection_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "term_to_binary_compat_prop_SUITE_beam_files", + testonly = True, + srcs = ["test/term_to_binary_compat_prop_SUITE.erl"], + outs = ["test/term_to_binary_compat_prop_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app", "@proper//:erlang_app"], + ) + erlang_bytecode( + name = "test_channel_operation_timeout_test_queue_beam", + testonly = True, + srcs = ["test/channel_operation_timeout_test_queue.erl"], + outs = ["test/channel_operation_timeout_test_queue.beam"], + beam = ["ebin/rabbit_backing_queue.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_dummy_event_receiver_beam", + testonly = True, + srcs = ["test/dummy_event_receiver.erl"], + outs = ["test/dummy_event_receiver.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_dummy_interceptor_beam", + testonly = True, + srcs = ["test/dummy_interceptor.erl"], + outs = ["test/dummy_interceptor.beam"], + beam = ["ebin/rabbit_channel_interceptor.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_dummy_runtime_parameters_beam", + testonly = True, + srcs = ["test/dummy_runtime_parameters.erl"], + outs = ["test/dummy_runtime_parameters.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_dummy_supervisor2_beam", + testonly = True, + srcs = ["test/dummy_supervisor2.erl"], + outs = ["test/dummy_supervisor2.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_failing_dummy_interceptor_beam", + testonly = True, + srcs = ["test/failing_dummy_interceptor.erl"], + outs = ["test/failing_dummy_interceptor.beam"], + beam = ["ebin/rabbit_channel_interceptor.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_mirrored_supervisor_SUITE_gs_beam", + testonly = True, + srcs = ["test/mirrored_supervisor_SUITE_gs.erl"], + outs = ["test/mirrored_supervisor_SUITE_gs.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "test_quorum_queue_utils_beam", + testonly = True, + srcs = ["test/quorum_queue_utils.erl"], + outs = ["test/quorum_queue_utils.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "test_rabbit_auth_backend_context_propagation_mock_beam", + testonly = True, + srcs = ["test/rabbit_auth_backend_context_propagation_mock.erl"], + outs = ["test/rabbit_auth_backend_context_propagation_mock.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_rabbit_dummy_protocol_connection_info_beam", + testonly = True, + srcs = ["test/rabbit_dummy_protocol_connection_info.erl"], + outs = ["test/rabbit_dummy_protocol_connection_info.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "test_rabbit_foo_protocol_connection_info_beam", + testonly = True, + srcs = ["test/rabbit_foo_protocol_connection_info.erl"], + outs = ["test/rabbit_foo_protocol_connection_info.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "test_rabbit_ha_test_consumer_beam", + testonly = True, + srcs = ["test/rabbit_ha_test_consumer.erl"], + outs = ["test/rabbit_ha_test_consumer.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "test_rabbit_ha_test_producer_beam", + testonly = True, + srcs = ["test/rabbit_ha_test_producer.erl"], + outs = ["test/rabbit_ha_test_producer.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "test_test_util_beam", + testonly = True, + srcs = ["test/test_util.erl"], + outs = ["test/test_util.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "topic_permission_SUITE_beam_files", + testonly = True, + srcs = ["test/topic_permission_SUITE.erl"], + outs = ["test/topic_permission_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "unit_access_control_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_access_control_SUITE.erl"], + outs = ["test/unit_access_control_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_access_control_authn_authz_context_propagation_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_access_control_authn_authz_context_propagation_SUITE.erl"], + outs = ["test/unit_access_control_authn_authz_context_propagation_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_access_control_credential_validation_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_access_control_credential_validation_SUITE.erl"], + outs = ["test/unit_access_control_credential_validation_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["@proper//:erlang_app"], + ) + erlang_bytecode( + name = "unit_amqp091_content_framing_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_amqp091_content_framing_SUITE.erl"], + outs = ["test/unit_amqp091_content_framing_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "unit_amqp091_server_properties_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_amqp091_server_properties_SUITE.erl"], + outs = ["test/unit_amqp091_server_properties_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_app_management_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_app_management_SUITE.erl"], + outs = ["test/unit_app_management_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_classic_mirrored_queue_sync_throttling_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_classic_mirrored_queue_sync_throttling_SUITE.erl"], + outs = ["test/unit_classic_mirrored_queue_sync_throttling_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "unit_classic_mirrored_queue_throughput_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_classic_mirrored_queue_throughput_SUITE.erl"], + outs = ["test/unit_classic_mirrored_queue_throughput_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_cluster_formation_locking_mocks_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_cluster_formation_locking_mocks_SUITE.erl"], + outs = ["test/unit_cluster_formation_locking_mocks_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_collections_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_collections_SUITE.erl"], + outs = ["test/unit_collections_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_config_value_encryption_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_config_value_encryption_SUITE.erl"], + outs = ["test/unit_config_value_encryption_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_connection_tracking_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_connection_tracking_SUITE.erl"], + outs = ["test/unit_connection_tracking_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_credit_flow_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_credit_flow_SUITE.erl"], + outs = ["test/unit_credit_flow_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_disk_monitor_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_disk_monitor_SUITE.erl"], + outs = ["test/unit_disk_monitor_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_file_handle_cache_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_file_handle_cache_SUITE.erl"], + outs = ["test/unit_file_handle_cache_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_gen_server2_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_gen_server2_SUITE.erl"], + outs = ["test/unit_gen_server2_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_gm_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_gm_SUITE.erl"], + outs = ["test/unit_gm_SUITE.beam"], + hdrs = ["include/gm_specs.hrl"], + beam = ["ebin/gm.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_log_management_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_log_management_SUITE.erl"], + outs = ["test/unit_log_management_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_operator_policy_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_operator_policy_SUITE.erl"], + outs = ["test/unit_operator_policy_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "unit_pg_local_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_pg_local_SUITE.erl"], + outs = ["test/unit_pg_local_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_plugin_directories_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_plugin_directories_SUITE.erl"], + outs = ["test/unit_plugin_directories_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "unit_plugin_versioning_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_plugin_versioning_SUITE.erl"], + outs = ["test/unit_plugin_versioning_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_policy_validators_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_policy_validators_SUITE.erl"], + outs = ["test/unit_policy_validators_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_priority_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_priority_queue_SUITE.erl"], + outs = ["test/unit_priority_queue_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_queue_consumers_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_queue_consumers_SUITE.erl"], + outs = ["test/unit_queue_consumers_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_stats_and_metrics_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_stats_and_metrics_SUITE.erl"], + outs = ["test/unit_stats_and_metrics_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "unit_supervisor2_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_supervisor2_SUITE.erl"], + outs = ["test/unit_supervisor2_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unit_vm_memory_monitor_SUITE_beam_files", + testonly = True, + srcs = ["test/unit_vm_memory_monitor_SUITE.erl"], + outs = ["test/unit_vm_memory_monitor_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "upgrade_preparation_SUITE_beam_files", + testonly = True, + srcs = ["test/upgrade_preparation_SUITE.erl"], + outs = ["test/upgrade_preparation_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "vhost_SUITE_beam_files", + testonly = True, + srcs = ["test/vhost_SUITE.erl"], + outs = ["test/vhost_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_cuttlefish_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_cuttlefish_SUITE.erl"], + outs = ["test/rabbit_cuttlefish_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "unicode_SUITE_beam_files", + testonly = True, + srcs = ["test/unicode_SUITE.erl"], + outs = ["test/unicode_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "bindings_SUITE_beam_files", + testonly = True, + srcs = ["test/bindings_SUITE.erl"], + outs = ["test/bindings_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app", "//deps/rabbitmq_ct_helpers:erlang_app"], + ) + erlang_bytecode( + name = "exchanges_SUITE_beam_files", + testonly = True, + srcs = ["test/exchanges_SUITE.erl"], + outs = ["test/exchanges_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_binding_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_binding_SUITE.erl"], + outs = ["test/rabbit_db_binding_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_exchange_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_exchange_SUITE.erl"], + outs = ["test/rabbit_db_exchange_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_maintenance_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_maintenance_SUITE.erl"], + outs = ["test/rabbit_db_maintenance_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "rabbit_db_msup_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_msup_SUITE.erl"], + outs = ["test/rabbit_db_msup_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_policy_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_policy_SUITE.erl"], + outs = ["test/rabbit_db_policy_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_queue_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_queue_SUITE.erl"], + outs = ["test/rabbit_db_queue_SUITE.beam"], + hdrs = ["include/amqqueue.hrl", "include/amqqueue_v2.hrl"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "rabbit_db_topic_exchange_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_db_topic_exchange_SUITE.erl"], + outs = ["test/rabbit_db_topic_exchange_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "test_test_rabbit_event_handler_beam", + testonly = True, + srcs = ["test/test_rabbit_event_handler.erl"], + outs = ["test/test_rabbit_event_handler.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + erlang_bytecode( + name = "per_node_limit_SUITE_beam_files", + testonly = True, + srcs = ["test/per_node_limit_SUITE.erl"], + outs = ["test/per_node_limit_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/amqp_client:erlang_app"], + ) diff --git a/deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel b/deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel index 3109c5f3da..f9cd5eda72 100644 --- a/deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel +++ b/deps/rabbit/apps/rabbitmq_prelaunch/BUILD.bazel @@ -1,12 +1,21 @@ +load("@rules_erlang//:eunit2.bzl", "eunit") load("@rules_erlang//:xref2.bzl", "xref") load("@rules_erlang//:dialyze.bzl", "dialyze", "plt") load( "//:rabbitmq.bzl", "APP_VERSION", "RABBITMQ_DIALYZER_OPTS", + "assert_suites", "rabbitmq_app", "rabbitmq_suite", ) +load( + ":app.bzl", + "all_beam_files", + "all_srcs", + "all_test_beam_files", + "test_suite_beam_files", +) APP_NAME = "rabbitmq_prelaunch" @@ -14,56 +23,83 @@ APP_DESCRIPTION = "RabbitMQ prelaunch setup" APP_MODULE = "rabbit_prelaunch_app" -RUNTIME_DEPS = [ - "@cuttlefish//:erlang_app", - "@thoas//:erlang_app", -] +all_beam_files(name = "all_beam_files") + +all_test_beam_files(name = "all_test_beam_files") + +all_srcs(name = "all_srcs") -DEPS = [ - "//deps/rabbit_common:erlang_app", -] +test_suite_beam_files(name = "test_suite_beam_files") + +# gazelle:erlang_app_dep thoas rabbitmq_app( + name = "erlang_app", + srcs = [":all_srcs"], + hdrs = [":public_hdrs"], app_description = APP_DESCRIPTION, app_module = APP_MODULE, app_name = APP_NAME, app_version = APP_VERSION, - runtime_deps = RUNTIME_DEPS, - deps = DEPS, + beam_files = [":beam_files"], + license_files = [":license_files"], + priv = [":priv"], + deps = [ + "//deps/rabbit_common:erlang_app", + "@cuttlefish//:erlang_app", + "@thoas//:erlang_app", + ], ) xref( + name = "xref", additional_libs = [ - "@systemd//:erlang_app", - "@osiris//:erlang_app", + "@systemd//:erlang_app", # keep + "@osiris//:erlang_app", # keep ], + target = ":erlang_app", ) plt( - name = "base_plt", + name = "deps_plt", apps = [ - "runtime_tools", - "eunit", + "runtime_tools", # keep + "eunit", # keep ], + for_target = ":erlang_app", + ignore_warnings = True, plt = "//:base_plt", - deps = DEPS + RUNTIME_DEPS + [ - "@systemd//:erlang_app", - "@osiris//:erlang_app", + deps = [ + "@osiris//:erlang_app", # keep + "@systemd//:erlang_app", # keep ], - ignore_warnings = True, ) dialyze( + name = "dialyze", dialyzer_opts = RABBITMQ_DIALYZER_OPTS, - plt = ":base_plt", + plt = ":deps_plt", + target = ":erlang_app", ) -suites = [ - rabbitmq_suite( - name = "rabbit_logger_std_h_SUITE", - ), - rabbitmq_suite( - name = "rabbit_prelaunch_file_SUITE", - size = "small", - ), -] +eunit( + name = "eunit", + target = ":test_erlang_app", +) + +rabbitmq_suite( + name = "rabbit_logger_std_h_SUITE", +) + +rabbitmq_suite( + name = "rabbit_prelaunch_file_SUITE", + size = "small", +) + +assert_suites() + +alias( + name = "rabbitmq_prelaunch", + actual = ":erlang_app", + visibility = ["//visibility:public"], +) diff --git a/deps/rabbit/apps/rabbitmq_prelaunch/app.bzl b/deps/rabbit/apps/rabbitmq_prelaunch/app.bzl new file mode 100644 index 0000000000..ba79aa173f --- /dev/null +++ b/deps/rabbit/apps/rabbitmq_prelaunch/app.bzl @@ -0,0 +1,84 @@ +load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode") +load("@rules_erlang//:filegroup.bzl", "filegroup") + +def all_beam_files(name = "all_beam_files"): + filegroup( + name = "beam_files", + srcs = [":other_beam"], + ) + erlang_bytecode( + name = "other_beam", + srcs = native.glob(["src/**/*.erl"]), + hdrs = [":public_and_private_hdrs"], + app_name = "rabbitmq_prelaunch", + dest = "ebin", + erlc_opts = "//:erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + +def all_test_beam_files(name = "all_test_beam_files"): + filegroup( + name = "test_beam_files", + testonly = True, + srcs = [":test_other_beam"], + ) + erlang_bytecode( + name = "test_other_beam", + testonly = True, + srcs = native.glob(["src/**/*.erl"]), + hdrs = [":public_and_private_hdrs"], + app_name = "rabbitmq_prelaunch", + dest = "test", + erlc_opts = "//:test_erlc_opts", + deps = ["//deps/rabbit_common:erlang_app"], + ) + +def all_srcs(name = "all_srcs"): + filegroup( + name = "all_srcs", + srcs = [":public_and_private_hdrs", ":srcs"], + ) + filegroup( + name = "public_and_private_hdrs", + srcs = [":private_hdrs", ":public_hdrs"], + ) + + filegroup( + name = "srcs", + srcs = native.glob([ + "src/**/*.app.src", + "src/**/*.erl", + ]), + ) + filegroup( + name = "priv", + srcs = native.glob(["priv/**/*"]), + ) + filegroup( + name = "private_hdrs", + srcs = native.glob(["src/**/*.hrl"]), + ) + filegroup( + name = "public_hdrs", + srcs = native.glob(["include/**/*.hrl"]), + ) + filegroup( + name = "license_files", + srcs = native.glob(["LICENSE*"]), + ) + +def test_suite_beam_files(name = "test_suite_beam_files"): + erlang_bytecode( + name = "rabbit_logger_std_h_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_logger_std_h_SUITE.erl"], + outs = ["test/rabbit_logger_std_h_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) + erlang_bytecode( + name = "rabbit_prelaunch_file_SUITE_beam_files", + testonly = True, + srcs = ["test/rabbit_prelaunch_file_SUITE.erl"], + outs = ["test/rabbit_prelaunch_file_SUITE.beam"], + erlc_opts = "//:test_erlc_opts", + ) diff --git a/deps/rabbit/test/dummy_runtime_parameters.erl b/deps/rabbit/test/dummy_runtime_parameters.erl index fb54f6af5e..b3b5e92e09 100644 --- a/deps/rabbit/test/dummy_runtime_parameters.erl +++ b/deps/rabbit/test/dummy_runtime_parameters.erl @@ -9,7 +9,7 @@ -behaviour(rabbit_runtime_parameter). -behaviour(rabbit_policy_validator). --include("rabbit.hrl"). +-include_lib("rabbit_common/include/rabbit.hrl"). -export([validate/5, notify/5, notify_clear/4]). -export([register/0, unregister/0]). diff --git a/deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel b/deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel index 8b81edc72e..a9a6d5efc0 100644 --- a/deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel +++ b/deps/rabbit/test/feature_flags_SUITE_data/my_plugin/BUILD.bazel @@ -1,15 +1,115 @@ -load("@rules_erlang//:erlang_app.bzl", "erlang_app") -load("//:rabbitmq.bzl", "BROKER_VERSION_REQUIREMENTS_ANY") +load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode") +load( + "//:rabbitmq.bzl", + "BROKER_VERSION_REQUIREMENTS_ANY", + "rabbitmq_app", +) + +# gazelle:erlang_generate_beam_files_macro false +# gazelle:erlang_always_generate_test_beam_files +# gazelle:erlang_skip_rules assert_suites2,xref,plt,dialyze + +# gazelle:erlang_app_dep rabbit_common +# gazelle:erlang_app_dep rabbit + +erlang_bytecode( + name = "other_beam", + srcs = [ + "src/my_plugin.erl", + ], + hdrs = [":public_and_private_hdrs"], + app_name = "my_plugin", + dest = "ebin", + erlc_opts = "//:erlc_opts", +) -DEPS = [ - "//deps/rabbit_common:erlang_app", - "//deps/rabbit:erlang_app", -] +erlang_bytecode( + name = "test_other_beam", + testonly = True, + srcs = [ + "src/my_plugin.erl", + ], + hdrs = [":public_and_private_hdrs"], + app_name = "my_plugin", + dest = "test", + erlc_opts = "//:test_erlc_opts", +) -erlang_app( +filegroup( + name = "beam_files", + srcs = [":other_beam"], +) + +filegroup( + name = "test_beam_files", + testonly = True, + srcs = [":test_other_beam"], +) + +filegroup( + name = "srcs", + srcs = [ + "src/my_plugin.erl", + ], +) + +filegroup( + name = "private_hdrs", + srcs = glob(["src/**/*.hrl"]), +) + +filegroup( + name = "public_hdrs", + srcs = glob(["include/**/*.hrl"]), +) + +filegroup( + name = "priv", + srcs = glob(["priv/**/*"]), +) + +filegroup(name = "licenses") + +filegroup( + name = "public_and_private_hdrs", + srcs = [ + ":private_hdrs", + ":public_hdrs", + ], +) + +filegroup( + name = "all_srcs", + srcs = [ + ":public_and_private_hdrs", + ":srcs", + ], +) + +rabbitmq_app( + name = "erlang_app", + srcs = [":all_srcs"], + hdrs = [":public_hdrs"], app_description = "Plugin to test feature flags", app_extra_keys = BROKER_VERSION_REQUIREMENTS_ANY, app_name = "my_plugin", app_version = "1.0.0", - deps = DEPS, + beam_files = [":beam_files"], + license_files = [":license_files"], + priv = [":priv"], + deps = [ + "//deps/rabbit:erlang_app", + "//deps/rabbit_common:erlang_app", + ], +) + +alias( + name = "my_plugin", + actual = ":erlang_app", + visibility = ["//visibility:public"], +) + +filegroup( + name = "license_files", + srcs = glob(["LICENSE*"]), ) diff --git a/deps/rabbit/test/rabbit_fifo_SUITE.erl b/deps/rabbit/test/rabbit_fifo_SUITE.erl index 12eaa04138..e04e5639d2 100644 --- a/deps/rabbit/test/rabbit_fifo_SUITE.erl +++ b/deps/rabbit/test/rabbit_fifo_SUITE.erl @@ -13,7 +13,7 @@ -include_lib("eunit/include/eunit.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). -include_lib("rabbit_common/include/rabbit_framing.hrl"). --include_lib("rabbit/src/rabbit_fifo.hrl"). +-include("rabbit_fifo.hrl"). %%%=================================================================== %%% Common Test callbacks diff --git a/deps/rabbit/test/rabbit_fifo_dlx_SUITE.erl b/deps/rabbit/test/rabbit_fifo_dlx_SUITE.erl index 47c84bb45d..b9ea9f4d88 100644 --- a/deps/rabbit/test/rabbit_fifo_dlx_SUITE.erl +++ b/deps/rabbit/test/rabbit_fifo_dlx_SUITE.erl @@ -10,8 +10,8 @@ -compile(export_all). -include_lib("eunit/include/eunit.hrl"). --include_lib("rabbit/src/rabbit_fifo.hrl"). --include_lib("rabbit/src/rabbit_fifo_dlx.hrl"). +-include("rabbit_fifo.hrl"). +-include("rabbit_fifo_dlx.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). %%%=================================================================== diff --git a/deps/rabbit/test/rabbit_fifo_prop_SUITE.erl b/deps/rabbit/test/rabbit_fifo_prop_SUITE.erl index 858ca426fb..5971a496da 100644 --- a/deps/rabbit/test/rabbit_fifo_prop_SUITE.erl +++ b/deps/rabbit/test/rabbit_fifo_prop_SUITE.erl @@ -9,8 +9,8 @@ -include_lib("proper/include/proper.hrl"). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). --include_lib("rabbit/src/rabbit_fifo.hrl"). --include_lib("rabbit/src/rabbit_fifo_dlx.hrl"). +-include("rabbit_fifo.hrl"). +-include("rabbit_fifo_dlx.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). -define(record_info(T,R),lists:zip(record_info(fields,T),tl(tuple_to_list(R)))). diff --git a/deps/rabbit/test/rabbit_fifo_v0_SUITE.erl b/deps/rabbit/test/rabbit_fifo_v0_SUITE.erl index 291971ba1a..aca3e5f52f 100644 --- a/deps/rabbit/test/rabbit_fifo_v0_SUITE.erl +++ b/deps/rabbit/test/rabbit_fifo_v0_SUITE.erl @@ -11,7 +11,7 @@ -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). --include("src/rabbit_fifo_v0.hrl"). +-include("rabbit_fifo_v0.hrl"). %%%=================================================================== %%% Common Test callbacks diff --git a/deps/rabbit/test/rabbit_stream_coordinator_SUITE.erl b/deps/rabbit/test/rabbit_stream_coordinator_SUITE.erl index b965ad167b..84f64b9dc7 100644 --- a/deps/rabbit/test/rabbit_stream_coordinator_SUITE.erl +++ b/deps/rabbit/test/rabbit_stream_coordinator_SUITE.erl @@ -8,7 +8,7 @@ -include_lib("eunit/include/eunit.hrl"). -include_lib("rabbit_common/include/rabbit.hrl"). --include_lib("rabbit/src/rabbit_stream_coordinator.hrl"). +-include("rabbit_stream_coordinator.hrl"). -define(STATE, rabbit_stream_coordinator). diff --git a/deps/rabbit/test/rabbit_stream_sac_coordinator_SUITE.erl b/deps/rabbit/test/rabbit_stream_sac_coordinator_SUITE.erl index 5dd546b2de..83b6824bbf 100644 --- a/deps/rabbit/test/rabbit_stream_sac_coordinator_SUITE.erl +++ b/deps/rabbit/test/rabbit_stream_sac_coordinator_SUITE.erl @@ -19,7 +19,7 @@ -compile(export_all). -include_lib("eunit/include/eunit.hrl"). --include_lib("rabbit/src/rabbit_stream_sac_coordinator.hrl"). +-include("rabbit_stream_sac_coordinator.hrl"). %%%=================================================================== %%% Common Test callbacks |