Skip to content

Commit

Permalink
redisbenchmark to valkeybenchmark in test suite
Browse files Browse the repository at this point in the history
Signed-off-by: Shivshankar-Reddy <[email protected]>
  • Loading branch information
Shivshankar-Reddy committed Apr 22, 2024
1 parent a989ee5 commit 5bb8abe
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Redis Test Suite
Valkey Test Suite
================

The normal execution mode of the test suite involves starting and manipulating
local `redis-server` instances, inspecting process state, log files, etc.
local `valkey-server` instances, inspecting process state, log files, etc.

The test suite also supports execution against an external server, which is
enabled using the `--host` and `--port` parameters. When executing against an
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/aof.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ tags {"aof external:skip"} {
}

start_server {overrides {appendonly {yes}}} {
test {Redis should not try to convert DEL into EXPIREAT for EXPIRE -1} {
test {Server should not try to convert DEL into EXPIREAT for EXPIRE -1} {
r set x 10
r expire x -1
}
Expand Down
26 changes: 13 additions & 13 deletions tests/integration/valkey-benchmark.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ tags {"benchmark network external:skip logreqres:skip"} {
r select 0

test {benchmark: set,get} {
set cmd [redisbenchmark $master_host $master_port "-c 5 -n 10 -t set,get"]
set cmd [valkeybenchmark $master_host $master_port "-c 5 -n 10 -t set,get"]
common_bench_setup $cmd
default_set_get_checks
}

test {benchmark: connecting using URI set,get} {
set cmd [redisbenchmarkuri $master_host $master_port "-c 5 -n 10 -t set,get"]
set cmd [valkeybenchmarkuri $master_host $master_port "-c 5 -n 10 -t set,get"]
common_bench_setup $cmd
default_set_get_checks
}

test {benchmark: connecting using URI with authentication set,get} {
r config set masterauth pass
set cmd [redisbenchmarkuriuserpass $master_host $master_port "default" pass "-c 5 -n 10 -t set,get"]
set cmd [valkeybenchmarkuriuserpass $master_host $master_port "default" pass "-c 5 -n 10 -t set,get"]
common_bench_setup $cmd
default_set_get_checks
}

test {benchmark: full test suite} {
set cmd [redisbenchmark $master_host $master_port "-c 10 -n 100"]
set cmd [valkeybenchmark $master_host $master_port "-c 10 -n 100"]
common_bench_setup $cmd

# ping total calls are 2*issued commands per test due to PING_INLINE and PING_MBULK
Expand All @@ -76,7 +76,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: multi-thread set,get} {
set cmd [redisbenchmark $master_host $master_port "--threads 10 -c 5 -n 10 -t set,get"]
set cmd [valkeybenchmark $master_host $master_port "--threads 10 -c 5 -n 10 -t set,get"]
common_bench_setup $cmd
default_set_get_checks

Expand All @@ -85,7 +85,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: pipelined full set,get} {
set cmd [redisbenchmark $master_host $master_port "-P 5 -c 10 -n 10010 -t set,get"]
set cmd [valkeybenchmark $master_host $master_port "-P 5 -c 10 -n 10010 -t set,get"]
common_bench_setup $cmd
assert_match {*calls=10010,*} [cmdstat set]
assert_match {*calls=10010,*} [cmdstat get]
Expand All @@ -97,7 +97,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: arbitrary command} {
set cmd [redisbenchmark $master_host $master_port "-c 5 -n 150 INCRBYFLOAT mykey 10.0"]
set cmd [valkeybenchmark $master_host $master_port "-c 5 -n 150 INCRBYFLOAT mykey 10.0"]
common_bench_setup $cmd
assert_match {*calls=150,*} [cmdstat incrbyfloat]
# assert one of the non benchmarked commands is not present
Expand All @@ -108,7 +108,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: keyspace length} {
set cmd [redisbenchmark $master_host $master_port "-r 50 -t set -n 1000"]
set cmd [valkeybenchmark $master_host $master_port "-r 50 -t set -n 1000"]
common_bench_setup $cmd
assert_match {*calls=1000,*} [cmdstat set]
# assert one of the non benchmarked commands is not present
Expand All @@ -119,7 +119,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: clients idle mode should return error when reached maxclients limit} {
set cmd [redisbenchmark $master_host $master_port "-c 10 -I"]
set cmd [valkeybenchmark $master_host $master_port "-c 10 -I"]
set original_maxclients [lindex [r config get maxclients] 1]
r config set maxclients 5
catch { exec {*}$cmd } error
Expand All @@ -128,7 +128,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
}

test {benchmark: read last argument from stdin} {
set base_cmd [redisbenchmark $master_host $master_port "-x -n 10 set key"]
set base_cmd [valkeybenchmark $master_host $master_port "-x -n 10 set key"]
set cmd "printf arg | $base_cmd"
common_bench_setup $cmd
r get key
Expand All @@ -137,7 +137,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
# tls specific tests
if {$::tls} {
test {benchmark: specific tls-ciphers} {
set cmd [redisbenchmark $master_host $master_port "-r 50 -t set -n 1000 --tls-ciphers \"DEFAULT:-AES128-SHA256\""]
set cmd [valkeybenchmark $master_host $master_port "-r 50 -t set -n 1000 --tls-ciphers \"DEFAULT:-AES128-SHA256\""]
common_bench_setup $cmd
assert_match {*calls=1000,*} [cmdstat set]
# assert one of the non benchmarked commands is not present
Expand All @@ -146,7 +146,7 @@ tags {"benchmark network external:skip logreqres:skip"} {

test {benchmark: tls connecting using URI with authentication set,get} {
r config set masterauth pass
set cmd [redisbenchmarkuriuserpass $master_host $master_port "default" pass "-c 5 -n 10 -t set,get"]
set cmd [valkeybenchmarkuriuserpass $master_host $master_port "default" pass "-c 5 -n 10 -t set,get"]
common_bench_setup $cmd
default_set_get_checks
}
Expand All @@ -155,7 +155,7 @@ tags {"benchmark network external:skip logreqres:skip"} {
r flushall
r config resetstat
set ciphersuites_supported 1
set cmd [redisbenchmark $master_host $master_port "-r 50 -t set -n 1000 --tls-ciphersuites \"TLS_AES_128_GCM_SHA256\""]
set cmd [valkeybenchmark $master_host $master_port "-r 50 -t set -n 1000 --tls-ciphersuites \"TLS_AES_128_GCM_SHA256\""]
if {[catch { exec {*}$cmd } error]} {
set first_line [lindex [split $error "\n"] 0]
if {[string match "*Invalid option*" $first_line]} {
Expand Down
14 changes: 7 additions & 7 deletions tests/support/benchmark.tcl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
proc redisbenchmark_tls_config {testsdir} {
proc valkeybenchmark_tls_config {testsdir} {
set tlsdir [file join $testsdir tls]
set cert [file join $tlsdir client.crt]
set key [file join $tlsdir client.key]
Expand All @@ -11,23 +11,23 @@ proc redisbenchmark_tls_config {testsdir} {
}
}

proc redisbenchmark {host port {opts {}}} {
proc valkeybenchmark {host port {opts {}}} {
set cmd [list src/valkey-benchmark -h $host -p $port]
lappend cmd {*}[redisbenchmark_tls_config "tests"]
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
lappend cmd {*}$opts
return $cmd
}

proc redisbenchmarkuri {host port {opts {}}} {
proc valkeybenchmarkuri {host port {opts {}}} {
set cmd [list src/valkey-benchmark -u redis://$host:$port]
lappend cmd {*}[redisbenchmark_tls_config "tests"]
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
lappend cmd {*}$opts
return $cmd
}

proc redisbenchmarkuriuserpass {host port user pass {opts {}}} {
proc valkeybenchmarkuriuserpass {host port user pass {opts {}}} {
set cmd [list src/valkey-benchmark -u redis://$user:$pass@$host:$port]
lappend cmd {*}[redisbenchmark_tls_config "tests"]
lappend cmd {*}[valkeybenchmark_tls_config "tests"]
lappend cmd {*}$opts
return $cmd
}
6 changes: 3 additions & 3 deletions tests/unit/expire.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ start_server {tags {"expire"}} {
assert_equal [r pexpiretime x] $abs_expire
}

test {Redis should actively expire keys incrementally} {
test {Server should actively expire keys incrementally} {
r flushdb
r psetex key1 500 a
r psetex key2 500 a
Expand All @@ -197,7 +197,7 @@ start_server {tags {"expire"}} {
}
}

test {Redis should lazy expire keys} {
test {Server should lazy expire keys} {
r flushdb
r debug set-active-expire 0
r psetex key1{t} 500 a
Expand Down Expand Up @@ -768,7 +768,7 @@ start_server {tags {"expire"}} {
assert_equal [r EXPIRE none 100 LT] 0
} {}

test {Redis should not propagate the read command on lazy expire} {
test {Server should not propagate the read command on lazy expire} {
r debug set-active-expire 0
r flushall ; # Clean up keyspace to avoid interference by keys from other tests
r set foo bar PX 1
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/hyperloglog.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ start_server {tags {"hll"}} {
set e
} {*WRONGTYPE*}

test {Fuzzing dense/sparse encoding: Redis should always detect errors} {
test {Fuzzing dense/sparse encoding: Server should always detect errors} {
for {set j 0} {$j < 1000} {incr j} {
r del hll
set items {}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/scripting.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ start_server {tags {"scripting repl external:skip"}} {
set e
} {*Invalid*flags*}

test "Test selective replication of certain Redis commands from Lua" {
test "Test selective replication of certain commands from Lua" {
r del a b c d
run_script {
redis.call('set','a','1');
Expand Down

0 comments on commit 5bb8abe

Please sign in to comment.