summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-11-21 14:15:53 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-21 03:50:48 +0000
commit14c4127600383e2fe8fd49efffb433fa9176cba3 (patch)
treec05b81b8c8029e061fefe03e30c008a95c6b2528
parentdc25f5f1429cac165869f3d7921f63c9b30869da (diff)
downloadmongo-14c4127600383e2fe8fd49efffb433fa9176cba3.tar.gz
Import wiredtiger: 6e9fb75859897ebd99a5db9ce767f27ee5a134d8 from branch mongodb-6.2
ref: 3fdcbdde0e..6e9fb75859 for: 6.2.0-rc2 WT-10152 Add a home directory option to the cppsuite
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/src/main/test.cpp3
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/src/main/test.h1
-rwxr-xr-xsrc/third_party/wiredtiger/test/cppsuite/tests/run.cpp29
4 files changed, 24 insertions, 11 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 6e95aa0ae9f..3e1f3f5c23d 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-6.2",
- "commit": "3fdcbdde0e500d84b0d4d49c6409274f0d78c74e"
+ "commit": "6e9fb75859897ebd99a5db9ce767f27ee5a134d8"
}
diff --git a/src/third_party/wiredtiger/test/cppsuite/src/main/test.cpp b/src/third_party/wiredtiger/test/cppsuite/src/main/test.cpp
index 6bea0949bb0..a42b176f491 100644
--- a/src/third_party/wiredtiger/test/cppsuite/src/main/test.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/src/main/test.cpp
@@ -131,7 +131,8 @@ test::run()
db_create_config += _args.wt_open_config;
/* Create connection. */
- connection_manager::instance().create(db_create_config, DEFAULT_DIR);
+ connection_manager::instance().create(
+ db_create_config, _args.home.empty() ? DEFAULT_DIR : _args.home);
/* Initiate the load stage of each component. */
for (const auto &it : _components)
diff --git a/src/third_party/wiredtiger/test/cppsuite/src/main/test.h b/src/third_party/wiredtiger/test/cppsuite/src/main/test.h
index 33df43728f9..5258c98a426 100644
--- a/src/third_party/wiredtiger/test/cppsuite/src/main/test.h
+++ b/src/third_party/wiredtiger/test/cppsuite/src/main/test.h
@@ -41,6 +41,7 @@ struct test_args {
const std::string test_config;
const std::string test_name;
const std::string wt_open_config;
+ const std::string home;
};
/*
diff --git a/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp b/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
index dbe5214b475..4306bd8722e 100755
--- a/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
+++ b/src/third_party/wiredtiger/test/cppsuite/tests/run.cpp
@@ -54,8 +54,8 @@ extern "C" {
/* Declarations to avoid the error raised by -Werror=missing-prototypes. */
const std::string parse_configuration_from_file(const std::string &filename);
void print_help();
-int64_t run_test(
- const std::string &test_name, const std::string &config, const std::string &wt_open_config);
+int64_t run_test(const std::string &test_name, const std::string &config,
+ const std::string &wt_open_config, const std::string &home);
const std::string
parse_configuration_from_file(const std::string &filename)
@@ -91,6 +91,7 @@ print_help()
std::cout << "\trun -C [WIREDTIGER_OPEN_CONFIGURATION]" << std::endl;
std::cout << "\trun -c [TEST_FRAMEWORK_CONFIGURATION]" << std::endl;
std::cout << "\trun -f [FILE]" << std::endl;
+ std::cout << "\trun -H [HOME]" << std::endl;
std::cout << "\trun -l [TRACE_LEVEL]" << std::endl;
std::cout << "\trun --list" << std::endl;
std::cout << "\trun -t [TEST_NAME]" << std::endl;
@@ -107,10 +108,11 @@ print_help()
<< std::endl;
std::cout << std::endl;
std::cout << "OPTIONS" << std::endl;
- std::cout << "\t-h Output a usage message and exit." << std::endl;
std::cout << "\t-C Additional WiredTiger open configuration." << std::endl;
std::cout << "\t-c Test framework configuration. Cannot be used with -f." << std::endl;
std::cout << "\t-f File that contains the configuration. Cannot be used with -C." << std::endl;
+ std::cout << "\t-H Specifies the database home directory." << std::endl;
+ std::cout << "\t-h Output a usage message and exit." << std::endl;
std::cout << "\t-l Trace level from 0 to 3. "
"1 is the default level, all warnings and errors are logged."
<< std::endl;
@@ -124,13 +126,16 @@ print_help()
* - config: defines the configuration used for the test.
*/
int64_t
-run_test(const std::string &test_name, const std::string &config, const std::string &wt_open_config)
+run_test(const std::string &test_name, const std::string &config, const std::string &wt_open_config,
+ const std::string &home)
{
int error_code = 0;
test_harness::logger::log_msg(LOG_TRACE, "Configuration\t:" + config);
- test_harness::test_args args = {
- .test_config = config, .test_name = test_name, .wt_open_config = wt_open_config};
+ test_harness::test_args args = {.test_config = config,
+ .test_name = test_name,
+ .wt_open_config = wt_open_config,
+ .home = home};
if (test_name == "bounded_cursor_perf")
bounded_cursor_perf(args).run();
@@ -178,7 +183,8 @@ get_default_config_path(const std::string &test_name)
int
main(int argc, char *argv[])
{
- std::string cfg, config_filename, current_cfg, current_test_name, test_name, wt_open_config;
+ std::string cfg, config_filename, current_cfg, current_test_name, home, test_name,
+ wt_open_config;
int64_t error_code = 0;
const std::vector<std::string> all_tests = {"bounded_cursor_perf",
"bounded_cursor_prefix_indices", "bounded_cursor_prefix_search_near",
@@ -234,6 +240,11 @@ main(int argc, char *argv[])
for (const auto &test_name : all_tests)
std::cout << "\t" << test_name << std::endl;
return 0;
+ } else if (option == "-H") {
+ if ((i + 1) < argc)
+ home = argv[++i];
+ else
+ error_code = -1;
} else
error_code = -1;
}
@@ -255,7 +266,7 @@ main(int argc, char *argv[])
else
current_cfg = cfg;
- error_code = run_test(current_test_name, current_cfg, wt_open_config);
+ error_code = run_test(current_test_name, current_cfg, wt_open_config, home);
/*
* The connection is usually closed using the destructor of the connection manager.
* Because it is a singleton and we are executing all tests, we are not going
@@ -280,7 +291,7 @@ main(int argc, char *argv[])
cfg = parse_configuration_from_file(config_filename);
else if (cfg.empty())
cfg = parse_configuration_from_file(get_default_config_path(current_test_name));
- error_code = run_test(current_test_name, cfg, wt_open_config);
+ error_code = run_test(current_test_name, cfg, wt_open_config, home);
}
}