Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
16ccd095
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看板
提交
16ccd095
编写于
11月 03, 2022
作者:
J
jiacy-jcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:add test case into ci
上级
c4d59126
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
4 deletion
+13
-4
tests/system-test/1-insert/delete_data.py
tests/system-test/1-insert/delete_data.py
+13
-4
未找到文件。
tests/system-test/1-insert/delete_data.py
浏览文件 @
16ccd095
...
@@ -30,8 +30,8 @@ class TDTestCase:
...
@@ -30,8 +30,8 @@ class TDTestCase:
self
.
setsql
=
TDSetSql
()
self
.
setsql
=
TDSetSql
()
self
.
stbname
=
'stb'
self
.
stbname
=
'stb'
self
.
ntbname
=
'ntb'
self
.
ntbname
=
'ntb'
self
.
rowNum
=
5
self
.
rowNum
=
10
self
.
tbnum
=
2
self
.
tbnum
=
3
self
.
ts
=
1537146000000
self
.
ts
=
1537146000000
self
.
binary_str
=
'taosdata'
self
.
binary_str
=
'taosdata'
self
.
nchar_str
=
'涛思数据'
self
.
nchar_str
=
'涛思数据'
...
@@ -110,13 +110,22 @@ class TDTestCase:
...
@@ -110,13 +110,22 @@ class TDTestCase:
tdSql
.
execute
(
f
'''insert into
{
tbname
}
values(
{
self
.
ts
+
i
}
,"
{
base_data
[
'binary'
]
}
")'''
)
tdSql
.
execute
(
f
'''insert into
{
tbname
}
values(
{
self
.
ts
+
i
}
,"
{
base_data
[
'binary'
]
}
")'''
)
elif
'nchar'
in
col_type
.
lower
():
elif
'nchar'
in
col_type
.
lower
():
tdSql
.
execute
(
f
'''insert into
{
tbname
}
values(
{
self
.
ts
+
i
}
,"
{
base_data
[
'nchar'
]
}
")'''
)
tdSql
.
execute
(
f
'''insert into
{
tbname
}
values(
{
self
.
ts
+
i
}
,"
{
base_data
[
'nchar'
]
}
")'''
)
def
delete_all_data
(
self
,
tbname
,
col_type
,
row_num
,
base_data
,
dbname
,
tb_type
,
tb_num
=
1
):
def
delete_all_data
(
self
,
tbname
,
col_type
,
row_num
,
base_data
,
dbname
,
tb_type
,
tb_num
=
1
,
stbname
=
''
):
tdSql
.
query
(
f
'select count(*) from
{
tbname
}
'
)
tdSql
.
execute
(
f
'delete from
{
tbname
}
'
)
tdSql
.
execute
(
f
'delete from
{
tbname
}
'
)
tdSql
.
execute
(
f
'flush database
{
dbname
}
'
)
tdSql
.
execute
(
f
'flush database
{
dbname
}
'
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
f
'select * from
{
tbname
}
'
)
tdSql
.
query
(
f
'select * from
{
tbname
}
'
)
tdSql
.
checkRows
(
0
)
tdSql
.
checkRows
(
0
)
if
tb_type
==
'ntb'
or
tb_type
==
'ctb'
:
if
tb_type
==
'ntb'
or
tb_type
==
'ctb'
:
if
tb_type
==
'ctb'
:
tdSql
.
query
(
f
'select count(*) from
{
stbname
}
'
)
if
tb_num
<=
1
:
if
len
(
tdSql
.
queryResult
)
!=
0
:
tdLog
.
exit
(
'delete case failure!'
)
else
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],(
tb_num
-
1
)
*
row_num
)
self
.
insert_base_data
(
col_type
,
tbname
,
row_num
,
base_data
)
self
.
insert_base_data
(
col_type
,
tbname
,
row_num
,
base_data
)
elif
tb_type
==
'stb'
:
elif
tb_type
==
'stb'
:
for
i
in
range
(
tb_num
):
for
i
in
range
(
tb_num
):
...
@@ -265,7 +274,7 @@ class TDTestCase:
...
@@ -265,7 +274,7 @@ class TDTestCase:
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(1)'
)
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(1)'
)
self
.
insert_base_data
(
col_type
,
f
'
{
self
.
stbname
}
_
{
i
}
'
,
self
.
rowNum
,
self
.
base_data
)
self
.
insert_base_data
(
col_type
,
f
'
{
self
.
stbname
}
_
{
i
}
'
,
self
.
rowNum
,
self
.
base_data
)
self
.
delete_one_row
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_type
,
col_name
,
self
.
base_data
,
self
.
rowNum
,
self
.
dbname
,
'ctb'
)
self
.
delete_one_row
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_type
,
col_name
,
self
.
base_data
,
self
.
rowNum
,
self
.
dbname
,
'ctb'
)
self
.
delete_all_data
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_type
,
self
.
rowNum
,
self
.
base_data
,
self
.
dbname
,
'ctb'
)
self
.
delete_all_data
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_type
,
self
.
rowNum
,
self
.
base_data
,
self
.
dbname
,
'ctb'
,
i
+
1
,
self
.
stbname
)
self
.
delete_error
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_name
,
col_type
,
self
.
base_data
)
self
.
delete_error
(
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_name
,
col_type
,
self
.
base_data
)
self
.
delete_rows
(
self
.
dbname
,
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_name
,
col_type
,
self
.
base_data
,
self
.
rowNum
,
'ctb'
)
self
.
delete_rows
(
self
.
dbname
,
f
'
{
self
.
stbname
}
_
{
i
}
'
,
col_name
,
col_type
,
self
.
base_data
,
self
.
rowNum
,
'ctb'
)
for
func
in
[
'first'
,
'last'
]:
for
func
in
[
'first'
,
'last'
]:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录