Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ac89d00b
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看板
未验证
提交
ac89d00b
编写于
3月 14, 2022
作者:
M
Minglei Jin
提交者:
GitHub
3月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10706 from taosdata/xiaoping/2.4
[TS-1304]<test>: add test case
上级
c064bbeb
0f5ee107
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
34 addition
and
7 deletion
+34
-7
tests/pytest/query/query.py
tests/pytest/query/query.py
+22
-0
tests/pytest/test.py
tests/pytest/test.py
+10
-3
tests/pytest/util/dockerNodes.py
tests/pytest/util/dockerNodes.py
+2
-4
未找到文件。
tests/pytest/query/query.py
浏览文件 @
ac89d00b
...
@@ -198,6 +198,28 @@ class TDTestCase:
...
@@ -198,6 +198,28 @@ class TDTestCase:
tdLog
.
info
(
"case for TS-636"
)
tdLog
.
info
(
"case for TS-636"
)
self
.
escape_ascii
()
self
.
escape_ascii
()
# TS-1304
tdLog
.
info
(
"case for JIRA TS-1304"
)
tdSql
.
execute
(
"create stable devices (ts timestamp,tempature int,humity float,`1name` int ) tags (`1devid` int,devname binary(20))"
)
tdSql
.
execute
(
"insert into devices_001 using devices tags (111,'zzm') values (now,10001,1,1)"
)
tdSql
.
execute
(
"insert into devices_001 using devices tags (222,'cxd') values (now + 1s,10002,2,2)"
)
tdSql
.
execute
(
"insert into devices_001 using devices tags (333,'cyt') values (now + 2s,10002,2,2)"
)
tdSql
.
error
(
"select 1name from devices"
)
tdSql
.
error
(
"select 1name from devices_001"
)
tdSql
.
error
(
"select 1devid from devices"
)
tdSql
.
error
(
"select 1devid from devices_001"
)
tdSql
.
query
(
"select `1name` from devices_001"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
1
,
0
,
2
)
tdSql
.
checkData
(
2
,
0
,
2
)
tdSql
.
query
(
"select `1devid` from devices_001"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
111
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
tests/pytest/test.py
浏览文件 @
ac89d00b
...
@@ -150,14 +150,21 @@ if __name__ == "__main__":
...
@@ -150,14 +150,21 @@ if __name__ == "__main__":
cluster
.
init
(
numOfNodes
,
dataDir
)
cluster
.
init
(
numOfNodes
,
dataDir
)
cluster
.
prepardBuild
()
cluster
.
prepardBuild
()
startArbitrator
=
False
arbitratorHost
=
"tdnode1"
for
i
in
range
(
numOfNodes
):
for
i
in
range
(
numOfNodes
):
if
ucase
.
updatecfgDict
.
get
(
'%d'
%
(
i
+
1
))
!=
None
:
if
ucase
.
updatecfgDict
.
get
(
'%d'
%
(
i
+
1
))
!=
None
:
config
=
dict
(
ucase
.
updatecfgDict
.
get
(
'%d'
%
(
i
+
1
)))
config
=
dict
(
ucase
.
updatecfgDict
.
get
(
'%d'
%
(
i
+
1
)))
print
(
config
)
print
(
config
)
for
key
,
value
in
config
.
items
():
for
key
,
value
in
config
.
items
():
print
(
key
,
value
,
i
+
1
)
if
key
==
"arbitrator"
:
startArbitrator
=
True
arbitratorHost
=
value
cluster
.
cfg
(
key
,
value
,
i
+
1
)
cluster
.
cfg
(
key
,
value
,
i
+
1
)
cluster
.
run
()
cluster
.
run
()
if
startArbitrator
:
hostname
=
value
.
split
(
":"
)[
0
]
cluster
.
startArbitrator
(
hostname
)
conn
=
cluster
.
conn
conn
=
cluster
.
conn
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
.
args
)
print
(
e
.
args
)
...
...
tests/pytest/util/dockerNodes.py
浏览文件 @
ac89d00b
...
@@ -142,10 +142,8 @@ class BuildDockerCluser:
...
@@ -142,10 +142,8 @@ class BuildDockerCluser:
print
(
"create dnode tdnode%d"
%
i
)
print
(
"create dnode tdnode%d"
%
i
)
self
.
cursor
.
execute
(
"create dnode tdnode%d"
%
i
)
self
.
cursor
.
execute
(
"create dnode tdnode%d"
%
i
)
def
startArbitrator
(
self
):
def
startArbitrator
(
self
,
hostname
=
'tdnode1'
):
for
i
in
range
(
1
,
self
.
numOfNodes
+
1
):
cmd
=
"docker exec -d $(docker ps|grep '%s'|awk '{print $1}') tarbitrator"
%
hostname
self
.
cfg
(
"arbitrator"
,
"tdnode1:6042"
,
i
)
cmd
=
"docker exec -d $(docker ps|grep tdnode1|awk '{print $1}') tarbitrator"
self
.
execCmd
(
cmd
)
self
.
execCmd
(
cmd
)
def
prepardBuild
(
self
):
def
prepardBuild
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录