Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
11aff692
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看板
未验证
提交
11aff692
编写于
7月 10, 2023
作者:
H
Hui Li
提交者:
GitHub
7月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21995 from taosdata/test/TD-25155-MAIN
test: add taosbenchmark mix and stt case to ci
上级
8e0714e9
295d515a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
368 addition
and
0 deletion
+368
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+2
-0
tests/system-test/5-taos-tools/taosbenchmark/insertMix.py
tests/system-test/5-taos-tools/taosbenchmark/insertMix.py
+102
-0
tests/system-test/5-taos-tools/taosbenchmark/json/insertMix.json
...ystem-test/5-taos-tools/taosbenchmark/json/insertMix.json
+81
-0
tests/system-test/5-taos-tools/taosbenchmark/json/stt.json
tests/system-test/5-taos-tools/taosbenchmark/json/stt.json
+81
-0
tests/system-test/5-taos-tools/taosbenchmark/stt.py
tests/system-test/5-taos-tools/taosbenchmark/stt.py
+102
-0
未找到文件。
tests/parallel_test/cases.task
浏览文件 @
11aff692
...
...
@@ -755,6 +755,8 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/odbc.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/insertMix.py -N 3
,,n,system-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/stt.py -N 3
#tsim test
,,y,script,./test.sh -f tsim/tmq/basic2Of2ConsOverlap.sim
...
...
tests/system-test/5-taos-tools/taosbenchmark/insertMix.py
0 → 100644
浏览文件 @
11aff692
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
os
import
subprocess
import
time
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
caseDescription
(
self
):
"""
[TD-13823] taosBenchmark test cases
"""
return
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
# comment off by Shuduo for CI self.replicaVar = int(replicaVar)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
if
(
platform
.
system
().
lower
()
==
'windows'
):
tool
=
tool
+
".exe"
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
"community"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
tool
)
in
files
:
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
"packaging"
not
in
rootRealPath
:
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
len
(
paths
)
==
0
:
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
checkDataCorrect
(
self
):
sql
=
"select count(*) from meters"
tdSql
.
query
(
sql
)
allCnt
=
tdSql
.
getData
(
0
,
0
)
if
allCnt
<
2000000
:
tdLog
.
exit
(
f
"taosbenchmark insert row small. row count=
{
allCnt
}
sql=
{
sql
}
"
)
return
# group by 10 child table
rowCnt
=
tdSql
.
query
(
"select count(*),tbname from meters group by tbname"
)
tdSql
.
checkRows
(
10
)
# interval
sql
=
"select count(*),max(ic),min(dc),last(*) from meters interval(1s)"
rowCnt
=
tdSql
.
query
(
sql
)
if
rowCnt
<
10
:
tdLog
.
exit
(
f
"taosbenchmark interval(1s) count small. row cout=
{
rowCnt
}
sql=
{
sql
}
"
)
return
# nest query
tdSql
.
query
(
"select count(*) from (select * from meters order by ts desc)"
)
tdSql
.
checkData
(
0
,
0
,
allCnt
)
def
run
(
self
):
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/insertMix.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
errcode
=
os
.
system
(
"%s"
%
cmd
)
if
errcode
!=
0
:
tdLog
.
exit
(
f
"execute taosBenchmark ret error code=
{
errcode
}
"
)
return
tdSql
.
execute
(
"use mixdb"
)
self
.
checkDataCorrect
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/5-taos-tools/taosbenchmark/json/insertMix.json
0 → 100644
浏览文件 @
11aff692
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"connection_pool_size"
:
8
,
"num_of_records_per_req"
:
3000
,
"thread_count"
:
10
,
"create_table_thread_count"
:
2
,
"result_file"
:
"./insert_res_mix.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"check_sql"
:
"yes"
,
"continue_if_fail"
:
"no"
,
"databases"
:
[
{
"dbinfo"
:
{
"name"
:
"mixdb"
,
"drop"
:
"yes"
,
"vgroups"
:
6
,
"replica"
:
3
,
"precision"
:
"ms"
,
"keep"
:
3650
,
"minRows"
:
100
,
"maxRows"
:
4096
},
"super_tables"
:
[
{
"name"
:
"meters"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10
,
"insert_rows"
:
300000
,
"childtable_prefix"
:
"d"
,
"insert_mode"
:
"taosc"
,
"insert_interval"
:
0
,
"timestamp_step"
:
100
,
"start_timestamp"
:
1500000000000
,
"disorder_ratio"
:
10
,
"update_ratio"
:
5
,
"delete_ratio"
:
1
,
"disorder_fill_interval"
:
300
,
"update_fill_interval"
:
25
,
"generate_row_rule"
:
2
,
"columns"
:
[
{
"type"
:
"bool"
,
"name"
:
"bc"
},
{
"type"
:
"float"
,
"name"
:
"fc"
,
"max"
:
1
,
"min"
:
0
},
{
"type"
:
"double"
,
"name"
:
"dc"
,
"max"
:
1
,
"min"
:
0
},
{
"type"
:
"tinyint"
,
"name"
:
"ti"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"smallint"
,
"name"
:
"si"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"int"
,
"name"
:
"ic"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"bigint"
,
"name"
:
"bi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"utinyint"
,
"name"
:
"uti"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"usmallint"
,
"name"
:
"usi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"uint"
,
"name"
:
"ui"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"ubigint"
,
"name"
:
"ubi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"binary"
,
"name"
:
"bin"
,
"len"
:
32
},
{
"type"
:
"nchar"
,
"name"
:
"nch"
,
"len"
:
64
}
],
"tags"
:
[
{
"type"
:
"tinyint"
,
"name"
:
"groupid"
,
"max"
:
10
,
"min"
:
1
},
{
"name"
:
"location"
,
"type"
:
"binary"
,
"len"
:
16
,
"values"
:
[
"San Francisco"
,
"Los Angles"
,
"San Diego"
,
"San Jose"
,
"Palo Alto"
,
"Campbell"
,
"Mountain View"
,
"Sunnyvale"
,
"Santa Clara"
,
"Cupertino"
]
}
]
}
]
}
]
}
tests/system-test/5-taos-tools/taosbenchmark/json/stt.json
0 → 100644
浏览文件 @
11aff692
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"connection_pool_size"
:
8
,
"num_of_records_per_req"
:
3000
,
"thread_count"
:
20
,
"create_table_thread_count"
:
5
,
"result_file"
:
"./insert_res_wal.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"databases"
:
[
{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"yes"
,
"flush_each_batch"
:
"yes"
,
"vgroups"
:
2
,
"replica"
:
1
,
"precision"
:
"ms"
,
"keep"
:
3650
,
"minRows"
:
100
,
"maxRows"
:
4096
},
"super_tables"
:
[
{
"name"
:
"meters"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
1000
,
"insert_rows"
:
2850
,
"childtable_prefix"
:
"d"
,
"insert_mode"
:
"taosc"
,
"insert_interval"
:
0
,
"timestamp_step"
:
10
,
"disorder_ratio"
:
10
,
"update_ratio"
:
5
,
"delete_ratio"
:
1
,
"disorder_fill_interval"
:
30
,
"update_fill_interval"
:
25
,
"generate_row_rule"
:
2
,
"start_timestamp"
:
"2022-01-01 10:00:00"
,
"columns"
:
[
{
"type"
:
"bool"
,
"name"
:
"bc"
},
{
"type"
:
"float"
,
"name"
:
"fc"
,
"max"
:
1
,
"min"
:
0
},
{
"type"
:
"double"
,
"name"
:
"dc"
,
"max"
:
1
,
"min"
:
0
},
{
"type"
:
"tinyint"
,
"name"
:
"ti"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"smallint"
,
"name"
:
"si"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"int"
,
"name"
:
"ic"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"bigint"
,
"name"
:
"bi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"utinyint"
,
"name"
:
"uti"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"usmallint"
,
"name"
:
"usi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"uint"
,
"name"
:
"ui"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"ubigint"
,
"name"
:
"ubi"
,
"max"
:
100
,
"min"
:
0
},
{
"type"
:
"binary"
,
"name"
:
"bin"
,
"len"
:
32
},
{
"type"
:
"nchar"
,
"name"
:
"nch"
,
"len"
:
64
}
],
"tags"
:
[
{
"type"
:
"tinyint"
,
"name"
:
"groupid"
,
"max"
:
10
,
"min"
:
1
},
{
"name"
:
"location"
,
"type"
:
"binary"
,
"len"
:
16
,
"values"
:
[
"San Francisco"
,
"Los Angles"
,
"San Diego"
,
"San Jose"
,
"Palo Alto"
,
"Campbell"
,
"Mountain View"
,
"Sunnyvale"
,
"Santa Clara"
,
"Cupertino"
]
}
]
}
]
}
]
}
tests/system-test/5-taos-tools/taosbenchmark/stt.py
0 → 100644
浏览文件 @
11aff692
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
os
import
subprocess
import
time
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
def
caseDescription
(
self
):
"""
[TD-13823] taosBenchmark test cases
"""
return
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
# comment off by Shuduo for CI self.replicaVar = int(replicaVar)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
if
(
platform
.
system
().
lower
()
==
'windows'
):
tool
=
tool
+
".exe"
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
"community"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
tool
)
in
files
:
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
"packaging"
not
in
rootRealPath
:
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
len
(
paths
)
==
0
:
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
tdLog
.
info
(
"taosBenchmark found in %s"
%
paths
[
0
])
return
paths
[
0
]
def
checkDataCorrect
(
self
):
sql
=
"select count(*) from meters"
tdSql
.
query
(
sql
)
allCnt
=
tdSql
.
getData
(
0
,
0
)
if
allCnt
<
2000000
:
tdLog
.
exit
(
f
"taosbenchmark insert row small. row count=
{
allCnt
}
sql=
{
sql
}
"
)
return
# group by 10 child table
rowCnt
=
tdSql
.
query
(
"select count(*),tbname from meters group by tbname"
)
tdSql
.
checkRows
(
1000
)
# interval
sql
=
"select count(*),max(ic),min(dc),last(*) from meters interval(1s)"
rowCnt
=
tdSql
.
query
(
sql
)
if
rowCnt
<
10
:
tdLog
.
exit
(
f
"taosbenchmark interval(1s) count small. row cout=
{
rowCnt
}
sql=
{
sql
}
"
)
return
# nest query
tdSql
.
query
(
"select count(*) from (select * from meters order by ts desc)"
)
tdSql
.
checkData
(
0
,
0
,
allCnt
)
def
run
(
self
):
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/stt.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
errcode
=
os
.
system
(
"%s"
%
cmd
)
if
errcode
!=
0
:
tdLog
.
exit
(
f
"execute taosBenchmark ret error code=
{
errcode
}
"
)
return
tdSql
.
execute
(
"use db"
)
self
.
checkDataCorrect
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录