From 87cec72d35825bdcee9d98526b9699d555d37ce0 Mon Sep 17 00:00:00 2001 From: Noah Watkins Date: Tue, 16 Jul 2024 22:35:21 -0700 Subject: [PATCH] bazel: add cloud storage clients library Signed-off-by: Noah Watkins --- src/v/cloud_storage_clients/BUILD | 63 ++++++++++++++ src/v/cloud_storage_clients/tests/BUILD | 110 ++++++++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 src/v/cloud_storage_clients/BUILD create mode 100644 src/v/cloud_storage_clients/tests/BUILD diff --git a/src/v/cloud_storage_clients/BUILD b/src/v/cloud_storage_clients/BUILD new file mode 100644 index 0000000000000..5e7644c5bb34b --- /dev/null +++ b/src/v/cloud_storage_clients/BUILD @@ -0,0 +1,63 @@ +load("//bazel:build.bzl", "redpanda_cc_library") + +redpanda_cc_library( + name = "cloud_storage_clients", + srcs = [ + "abs_client.cc", + "abs_error.cc", + "client_pool.cc", + "client_probe.cc", + "configuration.cc", + "s3_client.cc", + "s3_error.cc", + "util.cc", + "xml_sax_parser.cc", + ], + hdrs = [ + "abs_client.h", + "abs_error.h", + "client.h", + "client_pool.h", + "client_probe.h", + "configuration.h", + "logger.h", + "s3_client.h", + "s3_error.h", + "types.h", + "util.h", + "xml_sax_parser.h", + ], + # for libxml2 + exclude_layering_check = True, + include_prefix = "cloud_storage_clients", + visibility = ["//visibility:public"], + deps = [ + "//src/v/base", + "//src/v/bytes", + "//src/v/bytes:iobuf", + "//src/v/bytes:iostream", + "//src/v/bytes:streambuf", + "//src/v/cloud_roles", + "//src/v/config", + "//src/v/container:intrusive", + "//src/v/hashing:secure", + "//src/v/http", + "//src/v/json", + "//src/v/metrics", + "//src/v/model", + "//src/v/net", + "//src/v/ssx:future_util", + "//src/v/ssx:sformat", + "//src/v/strings:string_switch", + "//src/v/utils:base64", + "//src/v/utils:functional", + "//src/v/utils:log_hist", + "//src/v/utils:named_type", + "//src/v/utils:stop_signal", + "@boost//:beast", + "@boost//:lexical_cast", + "@boost//:property_tree", + "@libxml2", + "@seastar", + ], +) diff --git a/src/v/cloud_storage_clients/tests/BUILD b/src/v/cloud_storage_clients/tests/BUILD new file mode 100644 index 0000000000000..e9031998f11e6 --- /dev/null +++ b/src/v/cloud_storage_clients/tests/BUILD @@ -0,0 +1,110 @@ +load("//bazel:test.bzl", "redpanda_cc_btest", "redpanda_cc_gtest") + +redpanda_cc_btest( + name = "backend_detection_test", + timeout = "short", + srcs = [ + "backend_detection_test.cc", + ], + deps = [ + "//src/v/cloud_storage_clients", + "//src/v/config", + "//src/v/test_utils:seastar_boost", + "@boost//:test", + ], +) + +redpanda_cc_btest( + name = "client_pool_test", + timeout = "short", + srcs = [ + "client_pool_test.cc", + ], + deps = [ + "//src/v/base", + "//src/v/cloud_storage_clients", + "//src/v/test_utils:seastar_boost", + "@boost//:test", + "@seastar", + "@seastar//:testing", + ], +) + +redpanda_cc_btest( + name = "s3_client_test", + timeout = "short", + srcs = [ + "s3_client_test.cc", + ], + deps = [ + "//src/v/base", + "//src/v/bytes:iobuf", + "//src/v/bytes:iobuf_parser", + "//src/v/bytes:iostream", + "//src/v/cloud_storage_clients", + "//src/v/hashing:secure", + "//src/v/net", + "//src/v/test_utils:seastar_boost", + "//src/v/utils:base64", + "//src/v/utils:unresolved_address", + "@boost//:algorithm", + "@boost//:beast", + "@boost//:property_tree", + "@boost//:test", + "@seastar", + "@seastar//:testing", + ], +) + +redpanda_cc_btest( + name = "xml_sax_parser_test", + timeout = "short", + srcs = [ + "xml_sax_parser_test.cc", + ], + deps = [ + "//src/v/cloud_storage_clients", + "//src/v/test_utils:seastar_boost", + "@boost//:test", + ], +) + +redpanda_cc_btest( + name = "exception_test", + timeout = "short", + srcs = [ + "exception_test.cc", + ], + deps = [ + "//src/v/cloud_storage_clients", + "//src/v/test_utils:seastar_boost", + "@boost//:test", + "@seastar", + ], +) + +redpanda_cc_btest( + name = "util_test", + timeout = "short", + srcs = [ + "util_test.cc", + ], + deps = [ + "//src/v/cloud_storage_clients", + "//src/v/test_utils:seastar_boost", + "@boost//:test", + ], +) + +redpanda_cc_gtest( + name = "types_test", + timeout = "short", + srcs = [ + "types_test.cc", + ], + deps = [ + "//src/v/cloud_storage_clients", + "//src/v/config", + "//src/v/test_utils:gtest", + ], +)