Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
46a7c3c9
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
46a7c3c9
编写于
4月 24, 2020
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add insert/int.py and insert/float.py to test insert function.
[TD-167]
上级
0b8123f5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
16 deletion
+39
-16
tests/pytest/simpletest.sh
tests/pytest/simpletest.sh
+6
-0
tests/pytest/test.py
tests/pytest/test.py
+5
-2
tests/pytest/util/cases.py
tests/pytest/util/cases.py
+6
-2
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+21
-11
tests/pytest/util/sql.py
tests/pytest/util/sql.py
+1
-1
未找到文件。
tests/pytest/simpletest.sh
浏览文件 @
46a7c3c9
#!/bin/bash
#!/bin/bash
python3 ./test.py
-f
insert/basic.py
$1
python3 ./test.py
-f
insert/basic.py
$1
python3 ./test.py
-s
$1
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
-f
insert/int.py
$1
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
-f
insert/float.py
$1
python3 ./test.py
-s
$1
tests/pytest/test.py
浏览文件 @
46a7c3c9
...
@@ -100,12 +100,15 @@ if __name__ == "__main__":
...
@@ -100,12 +100,15 @@ if __name__ == "__main__":
tdDnodes
.
deploy
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
conn
=
taos
.
connect
(
conn
=
taos
.
connect
(
host
=
'1
92.168
.0.1'
,
host
=
'1
27.0
.0.1'
,
config
=
tdDnodes
.
getSimCfgPath
())
config
=
tdDnodes
.
getSimCfgPath
())
if
fileName
==
"all"
:
if
fileName
==
"all"
:
tdCases
.
runAllLinux
(
conn
)
tdCases
.
runAllLinux
(
conn
)
else
:
else
:
tdCases
.
runOneLinux
(
conn
,
fileName
)
try
:
tdCases
.
runOneLinux
(
conn
,
fileName
)
except
Exception
as
e
:
tdLog
.
exit
(
"failed: %s"
%
fileName
)
conn
.
close
()
conn
.
close
()
else
:
else
:
tdLog
.
notice
(
"Procedures for tdengine deployed in %s"
%
(
masterIp
))
tdLog
.
notice
(
"Procedures for tdengine deployed in %s"
%
(
masterIp
))
...
...
tests/pytest/util/cases.py
浏览文件 @
46a7c3c9
...
@@ -67,12 +67,16 @@ class TDCases:
...
@@ -67,12 +67,16 @@ class TDCases:
if
tmp
.
name
.
find
(
fileName
)
!=
-
1
:
if
tmp
.
name
.
find
(
fileName
)
!=
-
1
:
case
=
testModule
.
TDTestCase
()
case
=
testModule
.
TDTestCase
()
case
.
init
(
conn
)
case
.
init
(
conn
)
case
.
run
()
try
:
case
.
run
()
except
Exception
as
e
:
tdLog
.
notice
(
repr
(
e
))
tdLog
.
exit
(
"failed: %s"
%
fileName
)
case
.
stop
()
case
.
stop
()
runNum
+=
1
runNum
+=
1
continue
continue
tdLog
.
notice
(
"total %d Linux test case(s) executed"
%
(
runNum
))
tdLog
.
success
(
"total %d Linux test case(s) executed"
%
(
runNum
))
def
runAllWindows
(
self
,
conn
):
def
runAllWindows
(
self
,
conn
):
# TODO: load all Windows cases here
# TODO: load all Windows cases here
...
...
tests/pytest/util/dnodes.py
浏览文件 @
46a7c3c9
...
@@ -19,12 +19,19 @@ from util.log import *
...
@@ -19,12 +19,19 @@ from util.log import *
class
TDSimClient
:
class
TDSimClient
:
def
__init__
(
self
):
self
.
testCluster
=
False
def
init
(
self
,
path
):
def
init
(
self
,
path
):
self
.
__init__
()
self
.
path
=
path
self
.
path
=
path
def
getCfgDir
(
self
):
def
getCfgDir
(
self
):
return
self
.
cfgDir
return
self
.
cfgDir
def
setTestCluster
(
self
,
value
):
self
.
testCluster
=
value
def
cfg
(
self
,
option
,
value
):
def
cfg
(
self
,
option
,
value
):
cmd
=
"echo '%s %s' >> %s"
%
(
option
,
value
,
self
.
cfgPath
)
cmd
=
"echo '%s %s' >> %s"
%
(
option
,
value
,
self
.
cfgPath
)
if
os
.
system
(
cmd
)
!=
0
:
if
os
.
system
(
cmd
)
!=
0
:
...
@@ -55,8 +62,9 @@ class TDSimClient:
...
@@ -55,8 +62,9 @@ class TDSimClient:
if
os
.
system
(
cmd
)
!=
0
:
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
tdLog
.
exit
(
cmd
)
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
if
self
.
testCluster
:
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
...
@@ -128,11 +136,12 @@ class TDDnode:
...
@@ -128,11 +136,12 @@ class TDDnode:
if
self
.
testCluster
:
if
self
.
testCluster
:
self
.
startIP
()
self
.
startIP
()
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
if
self
.
testCluster
:
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
self
.
cfg
(
"publicIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"internalIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"publicIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"privateIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"internalIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"privateIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"dataDir"
,
self
.
dataDir
)
self
.
cfg
(
"dataDir"
,
self
.
dataDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
...
@@ -291,10 +300,6 @@ class TDDnodes:
...
@@ -291,10 +300,6 @@ class TDDnodes:
for
i
in
range
(
len
(
self
.
dnodes
)):
for
i
in
range
(
len
(
self
.
dnodes
)):
self
.
dnodes
[
i
].
init
(
self
.
path
)
self
.
dnodes
[
i
].
init
(
self
.
path
)
self
.
sim
=
TDSimClient
()
self
.
sim
.
init
(
self
.
path
)
self
.
sim
.
deploy
()
def
setTestCluster
(
self
,
value
):
def
setTestCluster
(
self
,
value
):
self
.
testCluster
=
value
self
.
testCluster
=
value
...
@@ -302,6 +307,11 @@ class TDDnodes:
...
@@ -302,6 +307,11 @@ class TDDnodes:
self
.
valgrind
=
value
self
.
valgrind
=
value
def
deploy
(
self
,
index
):
def
deploy
(
self
,
index
):
self
.
sim
=
TDSimClient
()
self
.
sim
.
init
(
self
.
path
)
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
self
.
sim
.
deploy
()
self
.
check
(
index
)
self
.
check
(
index
)
self
.
dnodes
[
index
-
1
].
setTestCluster
(
self
.
testCluster
)
self
.
dnodes
[
index
-
1
].
setTestCluster
(
self
.
testCluster
)
self
.
dnodes
[
index
-
1
].
setValgrind
(
self
.
valgrind
)
self
.
dnodes
[
index
-
1
].
setValgrind
(
self
.
valgrind
)
...
...
tests/pytest/util/sql.py
浏览文件 @
46a7c3c9
...
@@ -63,7 +63,7 @@ class TDSql:
...
@@ -63,7 +63,7 @@ class TDSql:
def
checkRows
(
self
,
expectRows
):
def
checkRows
(
self
,
expectRows
):
if
self
.
queryRows
!=
expectRows
:
if
self
.
queryRows
!=
expectRows
:
tdLog
.
exit
(
tdLog
.
exit
(
"sql:%.40s, queryRows:%d != expect:%d"
%
"
failed:
sql:%.40s, queryRows:%d != expect:%d"
%
(
self
.
sql
,
self
.
queryRows
,
expectRows
))
(
self
.
sql
,
self
.
queryRows
,
expectRows
))
tdLog
.
info
(
"sql:%.40s, queryRows:%d == expect:%d"
%
tdLog
.
info
(
"sql:%.40s, queryRows:%d == expect:%d"
%
(
self
.
sql
,
self
.
queryRows
,
expectRows
))
(
self
.
sql
,
self
.
queryRows
,
expectRows
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录