From bf8183d065f07b40d465cca818a51689036b7488 Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 26 Sep 2024 10:31:57 +0800 Subject: [PATCH] Add --cluster option to runtest to run only cluster tests (#1052) Currently cluster tests in unit/cluster are run as part of the ./runtest. Sometims we change the cluster code and only want to run cluster tests. This PR added a --cluster option to runtest so that we can run only cluster tests. Signed-off-by: Binbin --- tests/test_helper.tcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index b0177693b..665ba9771 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -15,6 +15,7 @@ source tests/support/util.tcl set dir [pwd] set ::all_tests [] +set ::cluster_all_test [] set ::module_api_all_tests [] set test_dirs { @@ -32,6 +33,11 @@ foreach test_dir $test_dirs { } } +set cluster_test_dir unit/cluster +foreach file [glob -nocomplain $dir/tests/$cluster_test_dir/*.tcl] { + lappend ::cluster_all_tests $cluster_test_dir/[file root [file tail $file]] +} + set moduleapi_test_dir unit/moduleapi foreach file [glob -nocomplain $dir/tests/$moduleapi_test_dir/*.tcl] { lappend ::module_api_all_tests $moduleapi_test_dir/[file root [file tail $file]] @@ -557,6 +563,7 @@ proc send_data_packet {fd status data {elapsed 0}} { proc print_help_screen {} { puts [join { + "--cluster Run the cluster tests, by default cluster tests run along with all tests." "--moduleapi Run the module API tests, this option should only be used in runtest-moduleapi which will build the test module." "--valgrind Run the test over valgrind." "--durable suppress test crashes and keep running" @@ -614,6 +621,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} { } } incr j + } elseif {$opt eq {--cluster}} { + set ::all_tests $::cluster_all_tests } elseif {$opt eq {--moduleapi}} { set ::all_tests $::module_api_all_tests } elseif {$opt eq {--config}} {