Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
26897c03
Commit
26897c03
authored
Aug 02, 2018
by
antirez
Browse files
Test suite: new --stop option.
It pauses the test execution once the first failure is found.
parent
d506334b
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/test_helper.tcl
View file @
26897c03
...
...
@@ -89,6 +89,7 @@ set ::last_progress [clock seconds]
set ::active_servers
{}
;
# Pids of active Redis instances.
set ::dont_clean 0
set ::wait_server 0
set ::stop_on_failure 0
# Set to 1 when we are running in client mode. The Redis test uses a
# server-client model to run tests simultaneously. The server instance
...
...
@@ -302,6 +303,11 @@ proc read_from_test_client fd {
puts $err
lappend ::failed_tests $err
set ::active_clients_task
(
$fd
)
"(ERR)
$data
"
if
{
$::stop
_on_failure
}
{
puts -nonewline
"(Test stopped, press enter to continue)"
flush stdout
gets stdin
}
}
elseif
{
$status
eq
{
exception
}}
{
puts
"
\[
[
colorstr red $status
]
\]
:
$data
"
kill_clients
...
...
@@ -433,10 +439,11 @@ proc print_help_screen {} {
"--clients <num> Number of test clients (default 16)."
"--timeout <sec> Test timeout in seconds (default 10 min)."
"--force-failure Force the execution of a test that always fails."
"--config <k> <v> extra config file argument"
"--skipfile <file> name of a file containing test names that should be skipped (one per line)"
"--dont-clean don't delete redis log files after the run"
"--wait-server wait after server is started (so that you can attach a debugger)"
"--config <k> <v> Extra config file argument"
"--skipfile <file> Name of a file containing test names that should be skipped (one per line)"
"--dont-clean Don't delete redis log files after the run"
"--stop Blocks once the first test fails"
"--wait-server Wait after server is started (so that you can attach a debugger)"
"--help Print this help screen."
}
"
\n
"
]
}
...
...
@@ -511,6 +518,8 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
set ::dont_clean 1
}
elseif
{
$opt
eq
{
--wait-server
}}
{
set ::wait_server 1
}
elseif
{
$opt
eq
{
--stop
}}
{
set ::stop_on_failure 1
}
elseif
{
$opt
eq
{
--timeout
}}
{
set ::timeout $arg
incr j
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment