Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
80b34c6b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
80b34c6b
编写于
11月 29, 2022
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add test cases
上级
d266d7a2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
94 addition
and
0 deletion
+94
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/system-test/99-TDcase/TD-20582.py
tests/system-test/99-TDcase/TD-20582.py
+93
-0
未找到文件。
tests/parallel_test/cases.task
浏览文件 @
80b34c6b
...
...
@@ -1016,6 +1016,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
#develop test
,,n,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
...
...
tests/system-test/99-TDcase/TD-20582.py
0 → 100644
浏览文件 @
80b34c6b
import
taos
import
sys
import
datetime
import
inspect
import
math
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
class
TDTestCase
:
# updatecfgDict = {'debugFlag': 143 ,"cDebugFlag":143,"uDebugFlag":143 ,"rpcDebugFlag":143 , "tmrDebugFlag":143 ,
# "jniDebugFlag":143 ,"simDebugFlag":143,"dDebugFlag":143, "dDebugFlag":143,"vDebugFlag":143,"mDebugFlag":143,"qDebugFlag":143,
# "wDebugFlag":143,"sDebugFlag":143,"tsdbDebugFlag":143,"tqDebugFlag":143 ,"fsDebugFlag":143 ,"udfDebugFlag":143}
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
def
prepare_datas
(
self
,
dbname
=
"db"
):
tdSql
.
execute
(
f
''' CREATE TABLE ac_stb (TS TIMESTAMP, C1 INT, C2 BIGINT, C3 FLOAT, C4 DOUBLE, C5 BINARY(10), C6 BOOL,
C7 SMALLINT, C8 TINYINT, C9 NCHAR(10)) TAGS (T1 INT);
'''
)
tdSql
.
execute
(
f
''' insert into ctb0 using ac_stb tags (1) values ( 1537146001000 , 1,1,1,1,'bin',1,1,1,'________')
( 1537146002000 , 2,2,2,2,'binar', 1,1,1,'nchar');
'''
)
tdSql
.
execute
(
f
''' insert into ntb0 using ac_stb tags (-1) values ( 1537146001000 , 1,1,1,1,'bin',1,1,1,'________')
( 1537146002000 , 2,2,2,2,'binar', 1,1,1,'nchar');
'''
)
tdSql
.
execute
(
f
''' insert into ntb0 using ac_stb tags (2) values ( 1537146003000 , 1,1,1,1,'bin',1,1,1,'________')
( 1537146004000 , 2,2,2,2,'binar', 1,1,1,'nchar');
'''
)
tdSql
.
execute
(
f
''' insert into ctb6 using ac_stb tags(1) values ( 1537146000000 , 1, 1, 1, 1, 'bin1', 1, 1, 1, '________1')
ctb6 using ac_stb tags(2) values ( 1537146000000 , 2, 2, 2, 2, 'bin2', 2, 2, 2, '________2')
ctb6 using ac_stb tags(3) values ( 1537146000000 , 3, 3, 3, 3, 'bin3', 3, 3, 3, '________3')
'''
)
def
check_result
(
self
,
dbname
=
"db"
):
tdSql
.
query
(
"select c1,c1,c2,c3,c4,c5,c7,c8,c9 from ac_stb"
)
tdSql
.
checkRows
(
7
)
tdSql
.
query
(
"select t1, count(*), first(c9) from ac_stb partition by t1 order by t1 asc slimit 3"
)
tdSql
.
checkRows
(
2
)
# TD-20582
tdSql
.
query
(
"explain analyze verbose true select count(*) from ac_stb where T1=1"
)
tdSql
.
checkRows
(
16
)
# TD-20581
tdSql
.
execute
(
"insert into ntb0 select * from ntb0"
)
tdSql
.
query
(
"select * from ntb0"
)
tdSql
.
checkRows
(
4
)
return
# basic query
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql
.
prepare
()
tdLog
.
printNoPrefix
(
"========== step1: create table =============="
)
self
.
prepare_datas
()
tdLog
.
printNoPrefix
(
"========== step2: check results =============="
)
self
.
check_result
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录