Skip to content

Commit

Permalink
Merge pull request #24597 from IoannisRP/ik-bazel-tests-pandaproxy
Browse files Browse the repository at this point in the history
pandaproxy: bazelize tests
  • Loading branch information
dotnwat authored Dec 18, 2024
2 parents 1f48080 + 8b8fef2 commit 7543221
Show file tree
Hide file tree
Showing 11 changed files with 315 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/v/kafka/client/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ redpanda_test_cc_library(
"//src/v/random:generators",
],
include_prefix = "kafka/client/test",
visibility = ["//visibility:public"],
deps = [
"//src/v/reflection:adl",
"//src/v/storage:record_batch_builder",
Expand Down
41 changes: 41 additions & 0 deletions src/v/pandaproxy/json/requests/test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "fetch",
timeout = "short",
srcs = [
"fetch.cc",
],
deps = [
"//src/v/base",
"//src/v/container:fragmented_vector",
"//src/v/json",
"//src/v/kafka/client/test:utils",
"//src/v/kafka/protocol",
"//src/v/model",
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "produce",
timeout = "short",
srcs = [
"produce.cc",
],
deps = [
"//src/v/base",
"//src/v/kafka/protocol:produce",
"//src/v/kafka/protocol/schemata:produce_response",
"//src/v/model",
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:to_string",
"@seastar",
"@seastar//:testing",
],
)
17 changes: 17 additions & 0 deletions src/v/pandaproxy/json/test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "iobuf",
timeout = "short",
srcs = [
"iobuf.cc",
],
deps = [
"//src/v/bytes:iobuf_parser",
"//src/v/json",
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)
35 changes: 35 additions & 0 deletions src/v/pandaproxy/parsing/test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "from_chars",
timeout = "short",
srcs = [
"from_chars.cc",
],
deps = [
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:named_type",
"@boost//:mpl",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "httpd",
timeout = "short",
srcs = [
"httpd.cc",
],
deps = [
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
"@boost//:tuple",
"@boost//:utility",
"@seastar",
"@seastar//:testing",
],
)
81 changes: 81 additions & 0 deletions src/v/pandaproxy/rest/test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "consumer_group",
timeout = "short",
srcs = [
"consumer_group.cc",
],
tags = ["exclusive"],
deps = [
"//src/v/http",
"//src/v/kafka/protocol:join_group",
"//src/v/pandaproxy",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:unresolved_address",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "fetch",
timeout = "short",
srcs = [
"fetch.cc",
],
tags = ["exclusive"],
deps = [
"//src/v/http",
"//src/v/pandaproxy",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "list_topics",
timeout = "short",
srcs = [
"list_topics.cc",
],
tags = ["exclusive"],
deps = [
"//src/v/http",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "produce",
timeout = "short",
srcs = [
"produce.cc",
],
tags = ["exclusive"],
deps = [
"//src/v/http",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)
1 change: 0 additions & 1 deletion src/v/pandaproxy/rest/test/produce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// by the Apache License, Version 2.0

#include "http/client.h"
#include "pandaproxy/rest/configuration.h"
#include "pandaproxy/test/pandaproxy_fixture.h"
#include "pandaproxy/test/utils.h"

Expand Down
32 changes: 32 additions & 0 deletions src/v/pandaproxy/schema_registry/requests/test/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "get_subject_versions_version",
timeout = "short",
srcs = [
"get_subject_versions_version.cc",
],
deps = [
"//src/v/base",
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "post_subject_versions",
timeout = "short",
srcs = [
"post_subject_versions.cc",
],
deps = [
"//src/v/base",
"//src/v/pandaproxy",
"//src/v/test_utils:seastar_boost",
"@fmt",
"@seastar",
"@seastar//:testing",
],
)
92 changes: 92 additions & 0 deletions src/v/pandaproxy/schema_registry/test/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
load("//bazel:test.bzl", "redpanda_cc_btest", "redpanda_test_cc_library")

redpanda_test_cc_library(
name = "avro_payloads",
hdrs = [
"avro_payloads.h",
],
include_prefix = "pandaproxy/schema_registry/test",
deps = [
"//src/v/pandaproxy",
],
)

redpanda_test_cc_library(
name = "client_utils",
hdrs = [
"client_utils.h",
],
include_prefix = "pandaproxy/schema_registry/test",
deps = [
"//src/v/http",
"//src/v/json",
"//src/v/pandaproxy",
"//src/v/pandaproxy/test:utils",
"@abseil-cpp//absl/algorithm:container",
"@boost//:beast",
],
)

redpanda_test_cc_library(
name = "compatibility_avro",
hdrs = [
Expand Down Expand Up @@ -132,6 +159,7 @@ redpanda_cc_btest(
srcs = [
"sharded_store.cc",
],
cpu = 1,
deps = [
"//src/v/pandaproxy",
"//src/v/pandaproxy/schema_registry/test:compatibility_protobuf",
Expand All @@ -148,6 +176,7 @@ redpanda_cc_btest(
srcs = [
"consume_to_store.cc",
],
cpu = 1,
deps = [
"//src/v/model",
"//src/v/pandaproxy",
Expand All @@ -164,6 +193,7 @@ redpanda_cc_btest(
srcs = [
"compatibility_store.cc",
],
cpu = 1,
deps = [
"//src/v/pandaproxy",
"//src/v/pandaproxy/schema_registry/test:compatibility_avro",
Expand All @@ -180,6 +210,7 @@ redpanda_cc_btest(
srcs = [
"compatibility_3rdparty.cc",
],
cpu = 1,
deps = [
"//src/v/model",
"//src/v/pandaproxy",
Expand All @@ -196,6 +227,7 @@ redpanda_cc_btest(
srcs = [
"compatibility_avro.cc",
],
cpu = 1,
deps = [
"//src/v/pandaproxy",
"//src/v/pandaproxy/schema_registry/test:compatibility_avro",
Expand All @@ -215,6 +247,7 @@ redpanda_cc_btest(
srcs = [
"test_json_schema.cc",
],
cpu = 1,
deps = [
"//src/v/pandaproxy",
"//src/v/pandaproxy/schema_registry/test:compatibility_common",
Expand All @@ -227,3 +260,62 @@ redpanda_cc_btest(
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "get_schema_types",
timeout = "short",
srcs = [
"get_schema_types.cc",
],
tags = ["exclusive"],
deps = [
"//src/v/http",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "post_subjects_subject_version",
timeout = "short",
srcs = [
"post_subjects_subject_version.cc",
],
tags = ["exclusive"],
deps = [
":avro_payloads",
":client_utils",
"//src/v/pandaproxy",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "delete_subject_endpoints",
timeout = "short",
srcs = [
"delete_subject_endpoints.cc",
],
tags = ["exclusive"],
deps = [
":avro_payloads",
":client_utils",
"//src/v/pandaproxy",
"//src/v/pandaproxy/test:fixture",
"//src/v/pandaproxy/test:utils",
"//src/v/test_utils:seastar_boost",
"@boost//:beast",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)
3 changes: 0 additions & 3 deletions src/v/pandaproxy/schema_registry/test/avro_payloads.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

#include "pandaproxy/schema_registry/avro.h"

namespace pp = pandaproxy;
namespace pps = pp::schema_registry;

const ss::sstring avro_string_payload{
R"(
{
Expand Down
Loading

0 comments on commit 7543221

Please sign in to comment.