-
Notifications
You must be signed in to change notification settings - Fork 601
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/test: use RP_FIXTURE_ENV=1 for all unit tests #24989
bazel/test: use RP_FIXTURE_ENV=1 for all unit tests #24989
Conversation
10b596e
to
86c6c42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bashtanov ! cc'ing @dotnwat and @rockwotj to make sure they're kosher with this global change.
CI test resultstest results on build#61432
test results on build#61450
test results on build#61610
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. I would have a slight preference for not baking this into our tests so universally so that people don't add more of this "testonly" backdoor, but we can always change this later. Thanks for fixing!
src/v/crypto/ossl_context_service.cc
Outdated
@@ -364,7 +364,8 @@ is_fips_mode ossl_context_service::fips_mode() const { | |||
} | |||
|
|||
bool ossl_context_service::in_rp_fixture_test() const { | |||
return ::getenv("RP_FIXTURE_ENV") != nullptr; | |||
char* val = ::getenv("RP_FIXTURE_ENV"); | |||
return val != nullptr && *val != '\0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I would rather check for a known explicit value here (1 yes or anything really) instead of just empty vs non empty
ae1d90b
86c6c42
to
ae1d90b
Compare
@@ -168,7 +168,7 @@ redpanda_cc_gtest( | |||
cpu = 2, | |||
data = common_data_deps, | |||
defines = ["FIPS_MODULE_REQUIRED"], | |||
env = common_env, | |||
env = common_env | {"RP_FIXTURE_ENV": ""}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just discussion: this is a bit awkward, right? like there is some aspect of fixture tests (whatever is testing in_rp_fixture_test()
) that should drive the name of this environment variable, rather than it being a "fixture test"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, personally I am not a fan of this method to toggle behavior deep in our crypto libraries. In terms of naming yeah this was just blanket added to every fixture test in CMake, and the crypto library does different stuff based on the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it becomes a misnomer this way. It'll probably be easier to rename it when cmake/ctest goes.
test failure unrelated, https://redpandadata.atlassian.net/browse/CORE-8990 created |
/dt |
1 similar comment
/dt |
We do not distinguish betwee unit and fixture tests in bazel, but fixture tests need RP_FIXTURE_ENV=1 to make adjustments for running multiple shards on the same thread. Add it for all tests by default, but allow individual tests override it.
That's for testing harness to unset it by assigning a different value.
`ossl_context_service` only works if we have one seastar shard per thread. RP_FIXTURE_ENV env variable disables the service to make it safe to run multiple seastar shards in a single thread. A lot of tests need this, so it is set by default. However, to test the service itself we need to enable it.
ae1d90b
to
38e2dd9
Compare
/dt |
We do not distinguish betwee unit and fixture tests in bazel, but fixture tests need RP_FIXTURE_ENV=1 to make adjustments for running multiple shards on the same thread. Add it for all tests.
Backports Required
Release Notes