提交 7f7499ee 编写于 作者: P Pieter Noordhuis

tags for existing tests

上级 73bd6c58
......@@ -22,14 +22,15 @@ proc start_server_aof {overrides code} {
kill_server $srv
}
## Test the server doesn't start when the AOF contains an unfinished MULTI
create_aof {
tags {"aof"} {
## Test the server doesn't start when the AOF contains an unfinished MULTI
create_aof {
append_to_aof [formatCommand set foo hello]
append_to_aof [formatCommand multi]
append_to_aof [formatCommand set bar world]
}
}
start_server_aof [list dir $server_path] {
start_server_aof [list dir $server_path] {
test {Unfinished MULTI: Server should not have been started} {
is_alive $srv
} {0}
......@@ -37,15 +38,15 @@ start_server_aof [list dir $server_path] {
test {Unfinished MULTI: Server should have logged an error} {
exec cat [dict get $srv stdout] | tail -n1
} {*Unexpected end of file reading the append only file*}
}
}
## Test that the server exits when the AOF contains a short read
create_aof {
## Test that the server exits when the AOF contains a short read
create_aof {
append_to_aof [formatCommand set foo hello]
append_to_aof [string range [formatCommand set bar world] 0 end-1]
}
}
start_server_aof [list dir $server_path] {
start_server_aof [list dir $server_path] {
test {Short read: Server should not have been started} {
is_alive $srv
} {0}
......@@ -53,22 +54,22 @@ start_server_aof [list dir $server_path] {
test {Short read: Server should have logged an error} {
exec cat [dict get $srv stdout] | tail -n1
} {*Bad file format reading the append only file*}
}
}
## Test that redis-check-aof indeed sees this AOF is not valid
test {Short read: Utility should confirm the AOF is not valid} {
## Test that redis-check-aof indeed sees this AOF is not valid
test {Short read: Utility should confirm the AOF is not valid} {
catch {
exec ./redis-check-aof $aof_path
} str
set _ $str
} {*not valid*}
} {*not valid*}
test {Short read: Utility should be able to fix the AOF} {
test {Short read: Utility should be able to fix the AOF} {
exec echo y | ./redis-check-aof --fix $aof_path
} {*Successfully truncated AOF*}
} {*Successfully truncated AOF*}
## Test that the server can be started using the truncated AOF
start_server_aof [list dir $server_path] {
## Test that the server can be started using the truncated AOF
start_server_aof [list dir $server_path] {
test {Fixed AOF: Server should have been started} {
is_alive $srv
} {1}
......@@ -77,4 +78,5 @@ start_server_aof [list dir $server_path] {
set client [redis [dict get $srv host] [dict get $srv port]]
list [$client get foo] [$client get bar]
} {hello {}}
}
}
start_server {} {
start_server {tags {"repl"}} {
r set mykey foo
start_server {} {
......
start_server {overrides {requirepass foobar}} {
start_server {tags {"auth"} overrides {requirepass foobar}} {
test {AUTH fails when a wrong password is given} {
catch {r auth wrong!} err
format $err
......
start_server {tags {basic}} {
start_server {tags {"basic"}} {
test {DEL all keys to start with a clean DB} {
foreach key [r keys *] {r del $key}
r dbsize
......@@ -52,7 +52,7 @@ start_server {tags {basic}} {
r get foo
} [string repeat "abcd" 1000000]
tags {slow} {
tags {"slow"} {
test {Very big payload random access} {
set err {}
array set payload {}
......
start_server {} {
start_server {tags {"cas"}} {
test {EXEC works on WATCHed key not modified} {
r watch x y z
r watch k
......
start_server {} {
start_server {tags {"expire"}} {
test {EXPIRE - don't set timeouts multiple times} {
r set x foobar
set v1 [r expire x 5]
......
start_server {} {
start_server {tags {"sort"}} {
test {SORT ALPHA against integer encoded strings} {
r del mylist
r lpush mylist 2
......@@ -8,6 +8,7 @@ start_server {} {
r sort mylist alpha
} {1 10 2 3}
tags {"slow"} {
test {Create a random list and a random set} {
set tosort {}
array set seenrand {}
......@@ -132,6 +133,7 @@ start_server {} {
flush stdout
format {}
} {}
}
test {SORT regression for issue #19, sorting floats} {
r flushdb
......
start_server {} {
start_server {tags {"hash"}} {
test {HSET/HLEN - Small hash creation} {
array set smallhash {}
for {set i 0} {$i < 8} {incr i} {
......
start_server {} {
start_server {tags {"list"}} {
test {Basic LPUSH, RPUSH, LLENGTH, LINDEX} {
set res [r lpush mylist a]
append res [r lpush mylist b]
......
start_server {} {
start_server {tags {"set"}} {
test {SADD, SCARD, SISMEMBER, SMEMBERS basics} {
r sadd myset foo
r sadd myset bar
......
start_server {} {
start_server {tags {"zset"}} {
test {ZSET basic ZADD and score update} {
r zadd ztmp 10 x
r zadd ztmp 20 y
......@@ -162,6 +162,7 @@ start_server {} {
r zrangebyscore zset 2 4 withscores
} {b 2 c 3 d 4}
tags {"slow"} {
test {ZRANGEBYSCORE fuzzy test, 100 ranges in 1000 elements sorted set} {
set err {}
r del zset
......@@ -241,6 +242,7 @@ start_server {} {
}
set _ $err
} {}
}
test {ZRANGEBYSCORE with LIMIT} {
r del zset
......@@ -356,6 +358,7 @@ start_server {} {
list [r zinterstore zsetc 2 zseta zsetb aggregate max] [r zrange zsetc 0 -1 withscores]
} {2 {b 2 c 3}}
tags {"slow"} {
test {ZSETs skiplist implementation backlink consistency test} {
set diff 0
set elements 10000
......@@ -397,6 +400,7 @@ start_server {} {
}
set _ $err
} {}
}
test {ZSET element can't be set to nan with ZADD} {
set e {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册