Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel/bench: add tests to benchmarks #24817

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion bazel/test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ changes. For example, redpanda_cc_gtest will automatically configure Seastar for
running tests, like setting a reasonable number of cores and amount of memory.
"""

load("@bazel_skylib//rules:write_file.bzl", "write_file")
load(":internal.bzl", "redpanda_copts")

def has_flags(args, *flags):
Expand Down Expand Up @@ -325,6 +326,7 @@ def redpanda_cc_bench(
name,
srcs = [],
defines = [],
timeout = "short",
deps = [],
args = [],
env = {},
Expand All @@ -346,6 +348,7 @@ def redpanda_cc_bench(
memory: the amount of RAM needed for the benchmark
data: any data files available to the benchmark as runfiles
tags: custom tags for the test
timeout: the timeout for smoke testing the benchmark
"""
args = [
"--blocked-reactor-notify-ms 2000000",
Expand Down Expand Up @@ -376,7 +379,28 @@ def redpanda_cc_bench(
features = [
"layering_check",
],
tags = resource_tags + tags,
tags = tags,
env = env,
data = data,
)
write_file(
name = name + "_test_script",
out = name + "_test_wrapper.sh",
content = [
"#!/bin/bash",
"exec $@ --iterations=1 --runs=1 --duration=0 --no-stdout --overprovisioned",
],
)
native.sh_test(
name = name + "_test",
timeout = timeout,
Comment on lines +391 to +396
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great idea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Borrowed it from envoyproxy - so keith probably 😛

tags = resource_tags + tags,
srcs = [name + "_test_script"],
env = env,
args = [
"$(rootpath :{})".format(name),
] + args,
data = [
":" + name,
] + data,
)
1 change: 1 addition & 0 deletions src/v/datalake/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ redpanda_cc_gtest(

redpanda_cc_bench(
name = "record_multiplexer_rpbench",
timeout = "long",
srcs = [
"record_multiplexer_bench.cc",
],
Expand Down
1 change: 1 addition & 0 deletions src/v/wasm/tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ redpanda_cc_gtest(

redpanda_cc_bench(
name = "wasm_transform_rpbench",
timeout = "moderate",
srcs = [
"wasm_transform_bench.cc",
],
Expand Down
Loading