Skip to content

Commit

Permalink
Update runtest test name and test filename (valkey-io#214)
Browse files Browse the repository at this point in the history
Update runtest test name and test filename

Signed-off-by: hwware <wen.hui.ware@gmail.com>
  • Loading branch information
hwware authored Apr 5, 2024
1 parent bb1a3ff commit 490f4eb
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions tests/integration/aof-multi-part.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ tags {"external:skip"} {
clean_aof_persistence $aof_dirpath
}

test {Multi Part AOF can upgrade when when two redis share the same server dir} {
test {Multi Part AOF can upgrade when when two servers share the same server dir} {
create_aof $server_path $aof_old_name_old_path {
append_to_aof [formatCommand set k1 v1]
append_to_aof [formatCommand set k2 v2]
Expand All @@ -609,7 +609,7 @@ tags {"external:skip"} {
start_server [list overrides [list dir $server_path appendonly yes appendfilename appendonly.aof2]] {
set redis2 [redis [srv host] [srv port] 0 $::tls]

test "Multi Part AOF can upgrade when when two redis share the same server dir (redis1)" {
test "Multi Part AOF can upgrade when when two servers share the same server dir (server1)" {
wait_done_loading $redis1
assert_equal v1 [$redis1 get k1]
assert_equal v2 [$redis1 get k2]
Expand Down Expand Up @@ -640,7 +640,7 @@ tags {"external:skip"} {
assert {$d1 eq $d2}
}

test "Multi Part AOF can upgrade when when two redis share the same server dir (redis2)" {
test "Multi Part AOF can upgrade when when two servers share the same server dir (server2)" {
wait_done_loading $redis2

assert_equal 0 [$redis2 exists k1]
Expand Down Expand Up @@ -700,7 +700,7 @@ tags {"external:skip"} {
clean_aof_persistence $aof_dirpath
}

test {Multi Part AOF can create BASE (RDB format) when redis starts from empty} {
test {Multi Part AOF can create BASE (RDB format) when server starts from empty} {
start_server_aof [list dir $server_path] {
set client [redis [srv host] [srv port] 0 $::tls]
wait_done_loading $client
Expand All @@ -723,7 +723,7 @@ tags {"external:skip"} {
clean_aof_persistence $aof_dirpath
}

test {Multi Part AOF can create BASE (AOF format) when redis starts from empty} {
test {Multi Part AOF can create BASE (AOF format) when server starts from empty} {
start_server_aof [list dir $server_path aof-use-rdb-preamble no] {
set client [redis [srv host] [srv port] 0 $::tls]
wait_done_loading $client
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/aof.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ tags {"aof external:skip"} {
}
}

## Test that redis-check-aof indeed sees this AOF is not valid
## Test that valkey-check-aof indeed sees this AOF is not valid
test "Short read: Utility should confirm the AOF is not valid" {
catch {
exec src/valkey-check-aof $aof_manifest_file
Expand Down Expand Up @@ -469,7 +469,7 @@ tags {"aof external:skip"} {
}
}

test {Test redis-check-aof for old style resp AOF} {
test {Test valkey-check-aof for old style resp AOF} {
create_aof $aof_dirpath $aof_file {
append_to_aof [formatCommand set foo hello]
append_to_aof [formatCommand set bar world]
Expand All @@ -481,7 +481,7 @@ tags {"aof external:skip"} {
assert_match "*Start checking Old-Style AOF*is valid*" $result
}

test {Test redis-check-aof for old style resp AOF - has data in the same format as manifest} {
test {Test valkey-check-aof for old style resp AOF - has data in the same format as manifest} {
create_aof $aof_dirpath $aof_file {
append_to_aof [formatCommand set file file]
append_to_aof [formatCommand set "file appendonly.aof.2.base.rdb seq 2 type b" "file appendonly.aof.2.base.rdb seq 2 type b"]
Expand All @@ -493,14 +493,14 @@ tags {"aof external:skip"} {
assert_match "*Start checking Old-Style AOF*is valid*" $result
}

test {Test redis-check-aof for old style rdb-preamble AOF} {
test {Test valkey-check-aof for old style rdb-preamble AOF} {
catch {
exec src/valkey-check-aof tests/assets/rdb-preamble.aof
} result
assert_match "*Start checking Old-Style AOF*RDB preamble is OK, proceeding with AOF tail*is valid*" $result
}

test {Test redis-check-aof for Multi Part AOF with resp AOF base} {
test {Test valkey-check-aof for Multi Part AOF with resp AOF base} {
create_aof $aof_dirpath $aof_base_file {
append_to_aof [formatCommand set foo hello]
append_to_aof [formatCommand set bar world]
Expand All @@ -522,7 +522,7 @@ tags {"aof external:skip"} {
assert_match "*Start checking Multi Part AOF*Start to check BASE AOF (RESP format)*BASE AOF*is valid*Start to check INCR files*INCR AOF*is valid*All AOF files and manifest are valid*" $result
}

test {Test redis-check-aof for Multi Part AOF with rdb-preamble AOF base} {
test {Test valkey-check-aof for Multi Part AOF with rdb-preamble AOF base} {
exec cp tests/assets/rdb-preamble.aof $aof_base_file

create_aof $aof_dirpath $aof_file {
Expand All @@ -541,7 +541,7 @@ tags {"aof external:skip"} {
assert_match "*Start checking Multi Part AOF*Start to check BASE AOF (RDB format)*DB preamble is OK, proceeding with AOF tail*BASE AOF*is valid*Start to check INCR files*INCR AOF*is valid*All AOF files and manifest are valid*" $result
}

test {Test redis-check-aof for Multi Part AOF contains a format error} {
test {Test valkey-check-aof for Multi Part AOF contains a format error} {
create_aof_manifest $aof_dirpath $aof_manifest_file {
append_to_manifest "file appendonly.aof.1.base.aof seq 1 type b\n"
append_to_manifest "file appendonly.aof.1.incr.aof seq 1 type i\n"
Expand All @@ -554,7 +554,7 @@ tags {"aof external:skip"} {
assert_match "*Invalid AOF manifest file format*" $result
}

test {Test redis-check-aof only truncates the last file for Multi Part AOF in fix mode} {
test {Test valkey-check-aof only truncates the last file for Multi Part AOF in fix mode} {
create_aof $aof_dirpath $aof_base_file {
append_to_aof [formatCommand set foo hello]
append_to_aof [formatCommand multi]
Expand Down Expand Up @@ -582,7 +582,7 @@ tags {"aof external:skip"} {
assert_match "*Failed to truncate AOF*because it is not the last file*" $result
}

test {Test redis-check-aof only truncates the last file for Multi Part AOF in truncate-to-timestamp mode} {
test {Test valkey-check-aof only truncates the last file for Multi Part AOF in truncate-to-timestamp mode} {
create_aof $aof_dirpath $aof_base_file {
append_to_aof "#TS:1628217470\r\n"
append_to_aof [formatCommand set foo1 bar1]
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ set ::all_tests {
integration/psync2-pingoff
integration/psync2-master-restart
integration/failover
integration/redis-cli
integration/redis-benchmark
integration/valkey-cli
integration/valkey-benchmark
integration/dismiss-mem
unit/pubsub
unit/pubsubshard
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/cluster/cli.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ start_multiple_servers 3 [list overrides $base_conf] {

} ;# stop servers

# Test redis-cli -- cluster create, add-node, call.
# Test valkey-cli -- cluster create, add-node, call.
# Test that functions are propagated on add-node
start_multiple_servers 5 [list overrides $base_conf] {

set node4_rd [redis_client -3]
set node5_rd [redis_client -4]

test {Functions are added to new node on redis-cli cluster add-node} {
test {Functions are added to new node on valkey-cli cluster add-node} {
exec src/valkey-cli --cluster-yes --cluster create \
127.0.0.1:[srv 0 port] \
127.0.0.1:[srv -1 port] \
Expand Down Expand Up @@ -221,9 +221,9 @@ start_multiple_servers 5 [list overrides $base_conf] {
}
} ;# stop servers

# Test redis-cli --cluster create, add-node.
# Test valkey-cli --cluster create, add-node.
# Test that one slot can be migrated to and then away from the new node.
test {Migrate the last slot away from a node using redis-cli} {
test {Migrate the last slot away from a node using valkey-cli} {
start_multiple_servers 4 [list overrides $base_conf] {

# Create a cluster of 3 nodes
Expand Down Expand Up @@ -329,7 +329,7 @@ test {Migrate the last slot away from a node using redis-cli} {

foreach ip_or_localhost {127.0.0.1 localhost} {

# Test redis-cli --cluster create, add-node with cluster-port.
# Test valkey-cli --cluster create, add-node with cluster-port.
# Create five nodes, three with custom cluster_port and two with default values.
start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cluster-port [find_available_port $::baseport $::portcount]]] {
start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1]] {
Expand All @@ -340,7 +340,7 @@ start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cl
# The first three are used to test --cluster create.
# The last two are used to test --cluster add-node

test "redis-cli -4 --cluster create using $ip_or_localhost with cluster-port" {
test "valkey-cli -4 --cluster create using $ip_or_localhost with cluster-port" {
exec src/valkey-cli -4 --cluster-yes --cluster create \
$ip_or_localhost:[srv 0 port] \
$ip_or_localhost:[srv -1 port] \
Expand All @@ -360,7 +360,7 @@ start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cl
assert_equal 3 [CI 2 cluster_known_nodes]
}

test "redis-cli -4 --cluster add-node using $ip_or_localhost with cluster-port" {
test "valkey-cli -4 --cluster add-node using $ip_or_localhost with cluster-port" {
# Adding node to the cluster (without cluster-port)
exec src/valkey-cli -4 --cluster-yes --cluster add-node \
$ip_or_localhost:[srv -3 port] \
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/functions.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ start_server {tags {"scripting"}} {
set _ {}
} {} {external:skip}

test {FUNCTION - redis version api} {
test {FUNCTION - valkey version api} {
r FUNCTION load replace {#!lua name=test
local version = redis.REDIS_VERSION_NUM

Expand Down
14 changes: 7 additions & 7 deletions tests/unit/introspection.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ start_server {tags {"introspection"}} {
assert {[dict exists $res bind]}
}

test {redis-server command line arguments - error cases} {
test {valkey-server command line arguments - error cases} {
# Take '--invalid' as the option.
catch {exec src/valkey-server --invalid} err
assert_match {*Bad directive or wrong number of arguments*} $err
Expand Down Expand Up @@ -749,36 +749,36 @@ start_server {tags {"introspection"}} {
assert_match {*'replicaof "--127.0.0.1"'*wrong number of arguments*} $err
} {} {external:skip}

test {redis-server command line arguments - allow passing option name and option value in the same arg} {
test {valkey-server command line arguments - allow passing option name and option value in the same arg} {
start_server {config "default.conf" args {"--maxmemory 700mb" "--maxmemory-policy volatile-lru"}} {
assert_match [r config get maxmemory] {maxmemory 734003200}
assert_match [r config get maxmemory-policy] {maxmemory-policy volatile-lru}
}
} {} {external:skip}

test {redis-server command line arguments - wrong usage that we support anyway} {
test {valkey-server command line arguments - wrong usage that we support anyway} {
start_server {config "default.conf" args {loglevel verbose "--maxmemory '700mb'" "--maxmemory-policy 'volatile-lru'"}} {
assert_match [r config get loglevel] {loglevel verbose}
assert_match [r config get maxmemory] {maxmemory 734003200}
assert_match [r config get maxmemory-policy] {maxmemory-policy volatile-lru}
}
} {} {external:skip}

test {redis-server command line arguments - allow option value to use the `--` prefix} {
test {valkey-server command line arguments - allow option value to use the `--` prefix} {
start_server {config "default.conf" args {--proc-title-template --my--title--template --loglevel verbose}} {
assert_match [r config get proc-title-template] {proc-title-template --my--title--template}
assert_match [r config get loglevel] {loglevel verbose}
}
} {} {external:skip}

test {redis-server command line arguments - option name and option value in the same arg and `--` prefix} {
test {valkey-server command line arguments - option name and option value in the same arg and `--` prefix} {
start_server {config "default.conf" args {"--proc-title-template --my--title--template" "--loglevel verbose"}} {
assert_match [r config get proc-title-template] {proc-title-template --my--title--template}
assert_match [r config get loglevel] {loglevel verbose}
}
} {} {external:skip}

test {redis-server command line arguments - save with empty input} {
test {valkey-server command line arguments - save with empty input} {
start_server {config "default.conf" args {--save --loglevel verbose}} {
assert_match [r config get save] {save {}}
assert_match [r config get loglevel] {loglevel verbose}
Expand Down Expand Up @@ -807,7 +807,7 @@ start_server {tags {"introspection"}} {

} {} {external:skip}

test {redis-server command line arguments - take one bulk string with spaces for MULTI_ARG configs parsing} {
test {valkey-server command line arguments - take one bulk string with spaces for MULTI_ARG configs parsing} {
start_server {config "default.conf" args {--shutdown-on-sigint nosave force now --shutdown-on-sigterm "nosave force"}} {
assert_match [r config get shutdown-on-sigint] {shutdown-on-sigint {nosave now force}}
assert_match [r config get shutdown-on-sigterm] {shutdown-on-sigterm {nosave force}}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/other.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ start_server {tags {"other"}} {
}

start_server {tags {"other external:skip"}} {
test {Don't rehash if redis has child process} {
test {Don't rehash if server has child process} {
r config set save ""
r config set rdb-key-save-delay 1000000

Expand Down
4 changes: 2 additions & 2 deletions tests/unit/scripting.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ start_server {tags {"scripting"}} {
run_script {local a = {}; setmetatable(a,{__index=function() foo() end}) return a} 0
} {}

test {EVAL - Return table with a metatable that call redis} {
test {EVAL - Return table with a metatable that call server} {
run_script {local a = {}; setmetatable(a,{__index=function() redis.call('set', 'x', '1') end}) return a} 1 x
# make sure x was not set
r get x
Expand Down Expand Up @@ -1042,7 +1042,7 @@ start_server {tags {"scripting"}} {
set _ $e
} {*Attempt to modify a readonly table*}

test "Try trick readonly table on redis table" {
test "Try trick readonly table on valkey table" {
catch {
run_script {
redis.call = function() return 1 end
Expand Down

0 comments on commit 490f4eb

Please sign in to comment.