Skip to content

Commit

Permalink
Merge pull request #24586 from IoannisRP/ik-bazel-tests-config
Browse files Browse the repository at this point in the history
config: bazelize unit tests
  • Loading branch information
rockwotj authored Dec 18, 2024
2 parents 126f8ca + 09a84e8 commit 2bc1658
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 7 deletions.
238 changes: 238 additions & 0 deletions src/v/config/tests/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
load("//bazel:test.bzl", "redpanda_cc_btest", "redpanda_cc_gtest")

redpanda_cc_btest(
name = "bounded_property_test",
timeout = "short",
srcs = [
"bounded_property_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "enum_property_test",
timeout = "short",
srcs = [
"enum_property_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "retention_property_test",
timeout = "short",
srcs = [
"retention_property_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "config_store_test",
timeout = "short",
srcs = [
"config_store_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/json",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "socket_address_convert_test",
timeout = "short",
srcs = [
"socket_address_convert_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "tls_config_convert_test",
timeout = "short",
srcs = [
"tls_config_convert_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:to_string",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "scoped_config_test",
timeout = "short",
srcs = [
"scoped_config_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:scoped_config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "advertised_kafka_api_test",
timeout = "short",
srcs = [
"advertised_kafka_api_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "seed_server_property_test",
timeout = "short",
srcs = [
"seed_server_property_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:unresolved_address",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "cloud_credentials_source_test",
timeout = "short",
srcs = [
"cloud_credentials_source_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "validator_test",
timeout = "short",
srcs = [
"validator_tests.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "throughput_control_group_test",
timeout = "short",
srcs = [
"throughput_control_group_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "node_override_test",
timeout = "short",
srcs = [
"node_override_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/model",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:uuid",
"@seastar",
"@seastar//:testing",
"@yaml-cpp",
],
)

redpanda_cc_btest(
name = "leaders_preference_test",
timeout = "short",
srcs = [
"leaders_preference_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_gtest(
name = "enterprise_property_test",
timeout = "short",
srcs = [
"enterprise_property_test.cc",
],
cpu = 1,
deps = [
"//src/v/config",
"//src/v/test_utils:gtest",
"@googletest//:gtest",
],
)
4 changes: 0 additions & 4 deletions src/v/config/tests/enterprise_property_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

#include <gtest/gtest-typed-test.h>
#include <gtest/gtest.h>
#include <yaml-cpp/yaml.h>

#include <concepts>
#include <iostream>

namespace config {
namespace {
Expand Down
3 changes: 0 additions & 3 deletions src/v/config/tests/throughput_control_group_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
#include <yaml-cpp/emitterstyle.h>
#include <yaml-cpp/exceptions.h>

#include <algorithm>
#include <exception>
#include <iterator>
#include <locale>
#include <vector>

using namespace std::string_literals;
Expand Down

0 comments on commit 2bc1658

Please sign in to comment.