Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2182f43b
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看板
提交
2182f43b
编写于
11月 04, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10789]<test>: add line_protocol into testcase of taosdemoSml
上级
3b0702bc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
61 addition
and
67 deletion
+61
-67
tests/pytest/tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json
...pytest/tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json
+54
-0
tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
...st/tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
+7
-67
未找到文件。
tests/pytest/tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json
浏览文件 @
2182f43b
...
...
@@ -83,6 +83,60 @@
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
},
{
"type"
:
"DOUBLE"
,
"count"
:
1
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
},
{
"type"
:
"BINARY"
,
"len"
:
32
,
"count"
:
1
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
}]
},
{
"name"
:
"stb2"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10
,
"childtable_prefix"
:
"stb00_"
,
"auto_create_table"
:
"no"
,
"batch_create_tbl_num"
:
1
,
"data_source"
:
"rand"
,
"insert_mode"
:
"sml"
,
"line_protocol"
:
"telnet"
,
"insert_rows"
:
100
,
"childtable_limit"
:
0
,
"childtable_offset"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"interlace_rows"
:
0
,
"insert_interval"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"DOUBLE"
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
}]
},
{
"name"
:
"stb3"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10
,
"childtable_prefix"
:
"stb00_"
,
"auto_create_table"
:
"no"
,
"batch_create_tbl_num"
:
1
,
"data_source"
:
"rand"
,
"insert_mode"
:
"sml"
,
"line_protocol"
:
"json"
,
"insert_rows"
:
100
,
"childtable_limit"
:
-1
,
"childtable_offset"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"interlace_rows"
:
0
,
"insert_interval"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
}]
}]
}]
}
tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
浏览文件 @
2182f43b
...
...
@@ -49,6 +49,7 @@ class TDTestCase:
binPath
=
buildPath
+
"/build/bin/"
# insert: create one or mutiple tables per sql and insert multiple rows per sql
# line_protocol——telnet and json
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/sml/insert-1s1tnt1r-sml.json -y "
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select count (tbname) from stb0"
)
...
...
@@ -116,30 +117,6 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
8
)
tdSql
.
query
(
"select count (tbname) from stb4"
)
tdSql
.
checkData
(
0
,
0
,
8
)
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-offset-sml.json -y" % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 50)
# tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 240)
# tdSql.query("select count(*) from stb2")
# tdSql.checkData(0, 0, 220)
# tdSql.query("select count(*) from stb3")
# tdSql.checkData(0, 0, 180)
# tdSql.query("select count(*) from stb4")
# tdSql.checkData(0, 0, 160)xxxxxxxxx
# os.system("%staosdemo -f tools/taosdemoAllTest/sml/insert-newtable-sml.json -y" % binPath)
# tdSql.execute("use db")
# tdSql.query("select count(*) from stb0")
# tdSql.checkData(0, 0, 150)
# tdSql.query("select count(*) from stb1")
# tdSql.checkData(0, 0, 360)
# tdSql.query("select count(*) from stb2")
# tdSql.checkData(0, 0, 360)
# tdSql.query("select count(*) from stb3")
# tdSql.checkData(0, 0, 340)
# tdSql.query("select count(*) from stb4")
# tdSql.checkData(0, 0, 400)
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/sml/insert-renewdb-sml.json -y"
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select count(*) from stb0"
)
...
...
@@ -208,18 +185,17 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
"2019-10-01 00:00:00"
)
tdSql
.
query
(
"select last(ts) from blf.p_0_topics_6 "
)
tdSql
.
checkData
(
0
,
0
,
"2020-09-29 23:59:00"
)
#
os.system("%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y " % binPath)
#
tdSql.execute("use db")
#
tdSql.query("select count(*) from stb0")
#
tdSql.checkData(0, 0, 5000000)
#
tdSql.query("select count(*) from stb1")
#
tdSql.checkData(0, 0, 5000000)
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/sml/insertMaxNumPerReq-sml.json -y "
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"select count(*) from stb0"
)
tdSql
.
checkData
(
0
,
0
,
5000000
)
tdSql
.
query
(
"select count(*) from stb1"
)
tdSql
.
checkData
(
0
,
0
,
5000000
)
# insert: timestamp and step
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/sml/insert-timestep-sml.json -y "
%
binPath
)
tdSql
.
execute
(
"use db"
)
tdSql
.
query
(
"show stables"
)
tdSql
.
query
(
"select count (tbname) from stb0"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count (tbname) from stb1"
)
...
...
@@ -266,42 +242,6 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
15000
)
# # insert: auto_create
# tdSql.execute('drop database if exists db')
# tdSql.execute('create database db')
# tdSql.execute('use db')
# os.system("%staosdemo -y -f tools/taosdemoAllTest/sml/insert-drop-exist-auto-N00-sml.json " % binPath) # drop = no, child_table_exists, auto_create_table varies
# tdSql.execute('use db')
# tdSql.query('show tables like \'NN123%\'') #child_table_exists = no, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NNN%\'') #child_table_exists = no, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NNY%\'') #child_table_exists = no, auto_create_table varies = yes
# tdSql.checkRows(20)
# tdSql.query('show tables like \'NYN%\'') #child_table_exists = yes, auto_create_table varies = no
# tdSql.checkRows(0)
# tdSql.query('show tables like \'NY123%\'') #child_table_exists = yes, auto_create_table varies = 123
# tdSql.checkRows(0)
# tdSql.query('show tables like \'NYY%\'') #child_table_exists = yes, auto_create_table varies = yes
# tdSql.checkRows(0)
# tdSql.execute('drop database if exists db')
# os.system("%staosdemo -y -f tools/taosdemoAllTest/sml/insert-drop-exist-auto-Y00-sml.json " % binPath) # drop = yes, child_table_exists, auto_create_table varies
# tdSql.execute('use db')
# tdSql.query('show tables like \'YN123%\'') #child_table_exists = no, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YNN%\'') #child_table_exists = no, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YNY%\'') #child_table_exists = no, auto_create_table varies = yes
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YYN%\'') #child_table_exists = yes, auto_create_table varies = no
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YY123%\'') #child_table_exists = yes, auto_create_table varies = 123
# tdSql.checkRows(20)
# tdSql.query('show tables like \'YYY%\'') #child_table_exists = yes, auto_create_table varies = yes
# tdSql.checkRows(20)
testcaseFilename
=
os
.
path
.
split
(
__file__
)[
-
1
]
os
.
system
(
"rm -rf ./insert_res.txt"
)
os
.
system
(
"rm -rf tools/taosdemoAllTest/%s.sql"
%
testcaseFilename
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录