test: extract debug::the_database out
we want to integrate some perf test into scylla executable, so we can run them on a regular basis. but `test/lib/cql_test_env.cc` shares `debug::the_database` with `main.cc`, so we cannot just compile them into a single binary without changing them. before this change, both `test/lib/cql_test_env.cc` and `main.cc` define `debug::the_database`. after this change, `debug::the_database` is extracted into `debug.cc`, so it compiles into a separate compiling unit. and scylla and tests using seastar testing framework are linked against `debug.cc` via `scylla_core` respectively. this paves the road to integrating scylla with the tests linking aginst `test/lib/cql_test_env.cc`. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
This commit is contained in:
@@ -668,6 +668,7 @@ scylla_core = (['message/messaging_service.cc',
|
||||
'caching_options.cc',
|
||||
'collection_mutation.cc',
|
||||
'client_data.cc',
|
||||
'debug.cc',
|
||||
'hashers.cc',
|
||||
'schema.cc',
|
||||
'frozen_schema.cc',
|
||||
|
||||
15
debug.cc
Normal file
15
debug.cc
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (C) 2023-present ScyllaDB
|
||||
*/
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include "debug.hh"
|
||||
|
||||
namespace debug {
|
||||
|
||||
seastar::sharded<replica::database>* the_database = nullptr;
|
||||
|
||||
}
|
||||
3
main.cc
3
main.cc
@@ -435,7 +435,6 @@ sharded<cql3::query_processor>* the_query_processor;
|
||||
sharded<qos::service_level_controller>* the_sl_controller;
|
||||
sharded<service::migration_manager>* the_migration_manager;
|
||||
sharded<service::storage_service>* the_storage_service;
|
||||
sharded<replica::database>* the_database;
|
||||
sharded<streaming::stream_manager> *the_stream_manager;
|
||||
sharded<gms::feature_service> *the_feature_service;
|
||||
sharded<gms::gossiper> *the_gossiper;
|
||||
@@ -1747,7 +1746,7 @@ static main_func_type lookup_main_func(std::string_view name) {
|
||||
{"types", tools::scylla_types_main},
|
||||
{"sstable", tools::scylla_sstable_main},
|
||||
};
|
||||
auto found = std::ranges::find_if(funcs, [name](auto& name_and_func) {
|
||||
auto found = std::ranges::find_if(funcs, [name] (auto& name_and_func) {
|
||||
return name_and_func.first == name;
|
||||
});
|
||||
if (found == std::end(funcs)) {
|
||||
|
||||
@@ -973,9 +973,3 @@ cql_test_config raft_cql_test_config() {
|
||||
c.db_config->consistent_cluster_management(true);
|
||||
return c;
|
||||
}
|
||||
|
||||
namespace debug {
|
||||
|
||||
seastar::sharded<replica::database>* the_database;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user