-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCL测试完善计划 #2531
Labels
Comments
Title: TCL test improvement plan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TCL 测试覆盖现状
背景
目前
Pika
的TCL
集成测试移植了Redis
的测试集,目前已经展开了测试类型包括printver
,basic
,scan
,expire
,multi
,quit
,pubsub
,slowlog
,maxmemory
,bitops
,hyperloglog
,type
,acl
,set
,list
,zset
,string
,hash
这几个类型,由于Pika
和Redis
之间存在一些差异,所以我们需要修改TCL
的代码来保证测试的正确性快速入门 TCL
以这段代码举例,
r
代表Redis
执行,所以下面这段代码意思是先执行Del novar
命令,然后再执行setnx novar foobared
命令检查返回值是不是1
, 然后执行get novar
检查返回值是不是foobared
,这就是一个最简单的TCL
样例Q&A
1. 目前还有很多
TCL
样例被注释了是为什么?Pika
的有些命令与Redis
命令并不是100%
兼容的,具体可以查看 Pika 支持的 Redis 接口及兼容情况Pika
中的Key
可以对应不同的数据结构,但是Redis
中一个Key
只能对应一种数据结构Pika
不支持Redis
中的一些命令,比如:sort
,rename
等等Pika
的返回值与Redis
不一致,是一个bug
需要进行修改2. 我应该怎么去修改目前存在
bug
的Pika
的TCL
测试呢?目前
Pika
的TCL
的代码在tests/unit
下方,以下面这个代码为例,对于所有存在Bug
的测试样例,我们目前都已经打上了Bug
注释,通过编辑器全局搜索# The return value of Pika is inconsistent with Redis
关键字可以很容易找到,然后进行问题复现并进行修复,如果需要提PR
修复的请关联此issue
, 当然如果你手动测试Pika
发现了问题,同样也可以新加一个TCL
的测试样例在相应文件下方,欢迎联系 @Mixficsol3. 目前被注释掉的
TCL
测试样例有几种类型?The return value of Pika is inconsistent with Redis
(Redis 的返回值和 Pika 这边不一致)Keys for multiple data types of Pika can be duplicate
由于Pika
中的Key
可以对应不同的数据结构,但是Redis
中一个Key
只能对应一种数据结构这种情况导致的返回值不一致This parameter is not available in Pika
(Redis 中有这个配置参数,但是 Pika 目前没有)Pika does not support the debug command
(Pika 中暂未实现这个命令)No cause has been confirmed
(暂时未确认原因)Currently Redis and Pika are consistent
(Redis 官网的返回和 Pika 一致,考虑需要修改 TCL)4. 现在所有的被注释掉的
TCL
测试都有以上这个相应的注解注释吗?目前我们只对
Zset
,Set
,Hash
,String
,List
,GEO
,Hyperloglog
,Stream
,Bitops
这几种常用的数据结构以及Multi(事务)
的TCL
测试进行了注解补充,后续我们会继续对剩下类型的TCL
测试进行注解补充5.怎么对一个 TCL 测试进行修复?
只需要简单的 4 步,Pika 的 TCL 代码在
test/unit/
目录下,我们以下面这个例子来说明:The return value of Pika is inconsistent with Redis
test/unit/type/zset.tcl
路径下./pikatest.sh type/zset clean
命令启动测试测试样例代码 1:
test/unit/type/zset.tcl
Pika 命令返回:
Redis 命令返回:
TCL 测试目前进度
我们主要是对 1.
The return value of Pika is inconsistent with Redis
, 2.No cause has been confirmed
, 3.Currently Redis and Pika are consistent
这三个注释类型优先进行修复,优先级从高到低,优先级最高的是The return value of Pika is inconsistent with Redis
。目前对Stream
,Bitops
,Hyperloglog
,Multi
,GEO
测试还需要进行修复The text was updated successfully, but these errors were encountered: