summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authoryoav-steinberg <yoav@monfort.co.il>2021-11-11 13:04:02 +0200
committerGitHub <noreply@github.com>2021-11-11 13:04:02 +0200
commitcd6b3d558be0703b1a43f9fe58fd5f1ed7452829 (patch)
treef703402582bf89a68a919e88b889ee50cc97d800 /tests/support
parentf069d09ee0e266064ab3b2d63390910accd47fbf (diff)
downloadredis-cd6b3d558be0703b1a43f9fe58fd5f1ed7452829.tar.gz
Archive external redis log in external tests (#9765)
On test failure store the external redis server logs as CI artifacts so we can review them. Write test name to server log for external server tests. This is attempted and silently failed in case external server doesn't support it. Note that in non-external server mode we use a more robust method of writing to the log which doesn't depend on the server actually running/working. This isn't possible for externl servers and required for some complex tests which are skipped in external mode anyway. Cleanup: remove dup code.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/test.tcl10
-rw-r--r--tests/support/util.tcl8
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index 22f7926da..118300dbc 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -152,11 +152,17 @@ proc test {name code {okpattern undefined} {tags {}}} {
set details {}
lappend details "$name in $::curfile"
- # set a cur_test global to be logged into new servers that are spown
+ # set a cur_test global to be logged into new servers that are spawn
# and log the test name in all existing servers
set prev_test $::cur_test
set ::cur_test "$name in $::curfile"
- if {!$::external} {
+ if {$::external} {
+ catch {
+ set r [redis [srv 0 host] [srv 0 port] 0 $::tls]
+ $r debug log "### Starting test $::cur_test"
+ $r close
+ }
+ } else {
foreach srv $::servers {
set stdout [dict get $srv stdout]
set fd [open $stdout "a+"]
diff --git a/tests/support/util.tcl b/tests/support/util.tcl
index d6f8fc062..23684be3f 100644
--- a/tests/support/util.tcl
+++ b/tests/support/util.tcl
@@ -699,14 +699,6 @@ proc generate_fuzzy_traffic_on_key {key duration} {
return $sent
}
-# write line to server log file
-proc write_log_line {srv_idx msg} {
- set logfile [srv $srv_idx stdout]
- set fd [open $logfile "a+"]
- puts $fd "### $msg"
- close $fd
-}
-
proc string2printable s {
set res {}
set has_special_chars false