Skip to content

Commit

Permalink
Add --cluster option to runtest to run only cluster tests (#1052)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
enjoy-binbin authored Sep 26, 2024
1 parent 983bb51 commit bf8183d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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]]
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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}} {
Expand Down

0 comments on commit bf8183d

Please sign in to comment.