Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
91a3148a
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看板
未验证
提交
91a3148a
编写于
2月 03, 2021
作者:
H
huili
提交者:
GitHub
2月 03, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5113 from taosdata/xiaoping/add_test_case
[TD-2850][TD-2671]<test>: add test case
上级
3bf73df9
bdc6e4f0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
3 deletion
+57
-3
tests/pytest/query/query.py
tests/pytest/query/query.py
+12
-0
tests/pytest/stable/insert.py
tests/pytest/stable/insert.py
+34
-0
tests/pytest/tools/taosdemoTest2.py
tests/pytest/tools/taosdemoTest2.py
+11
-3
未找到文件。
tests/pytest/query/query.py
浏览文件 @
91a3148a
...
...
@@ -111,6 +111,18 @@ class TDTestCase:
tdSql
.
query
(
"select * from tb where c5 = 'true' "
)
tdSql
.
checkRows
(
5
)
# For jira: https://jira.taosdata.com:18080/browse/TD-2850
tdSql
.
execute
(
"create database 'Test' "
)
tdSql
.
execute
(
"use 'Test' "
)
tdSql
.
execute
(
"create table 'TB'(ts timestamp, 'Col1' int) tags('Tag1' int)"
)
tdSql
.
execute
(
"insert into 'Tb0' using tb tags(1) values(now, 1)"
)
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from tb0"
)
tdSql
.
checkRows
(
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
tests/pytest/stable/insert.py
浏览文件 @
91a3148a
...
...
@@ -47,6 +47,40 @@ class TDTestCase:
tdSql
.
query
(
"select * from db.st where dev='dev_02'"
)
tdSql
.
checkRows
(
1
)
#For: https://jira.taosdata.com:18080/browse/TD-2671
print
(
"==============step3"
)
tdSql
.
execute
(
"create stable if not exists stb (ts timestamp, tagtype int) tags(dev nchar(50))"
)
tdSql
.
execute
(
'CREATE TABLE if not exists dev_01 using stb tags("dev_01")'
)
tdSql
.
execute
(
'CREATE TABLE if not exists dev_02 using stb tags("dev_02")'
)
print
(
"==============step4"
)
tdSql
.
execute
(
"""INSERT INTO dev_01(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
('2020-05-13 10:00:00.001', 1)
dev_02 VALUES('2020-05-13 10:00:00.001', 1)"""
)
tdSql
.
query
(
"select * from db.stb where dev='dev_01'"
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select * from db.stb where dev='dev_02'"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"describe db.stb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
execute
(
"alter stable db.stb add tag t1 int"
)
tdSql
.
query
(
"describe db.stb"
)
tdSql
.
checkRows
(
4
)
tdSql
.
execute
(
"drop stable db.stb"
)
tdSql
.
query
(
"show stables"
)
tdSql
.
checkRows
(
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
tests/pytest/tools/taosdemoTest2.py
浏览文件 @
91a3148a
...
...
@@ -31,10 +31,18 @@ class TDTestCase:
def
insertDataAndAlterTable
(
self
,
threadID
):
if
(
threadID
==
0
):
os
.
system
(
"yes | taosdemo -t %d -n %d"
%
(
self
.
numberOfTables
,
self
.
numberOfRecords
))
os
.
system
(
"yes | taosdemo -t %d -n %d
-x
"
%
(
self
.
numberOfTables
,
self
.
numberOfRecords
))
if
(
threadID
==
1
):
print
(
"use test"
)
tdSql
.
execute
(
"use test"
)
while
True
:
print
(
"query started"
)
tdSql
.
query
(
"select * from test.t9"
)
rows
=
tdSql
.
queryRows
print
(
"rows %d"
%
rows
)
if
(
rows
>
0
):
break
time
.
sleep
(
1
)
print
(
"alter table test.meters add column f4 int"
)
tdSql
.
execute
(
"alter table test.meters add column f4 int"
)
print
(
"insert into test.t0 values (now, 1, 2, 3, 4)"
)
...
...
@@ -46,8 +54,8 @@ class TDTestCase:
t1
=
threading
.
Thread
(
target
=
self
.
insertDataAndAlterTable
,
args
=
(
0
,
))
t2
=
threading
.
Thread
(
target
=
self
.
insertDataAndAlterTable
,
args
=
(
1
,
))
t1
.
start
()
time
.
sleep
(
2
)
t1
.
start
()
time
.
sleep
(
2
)
t2
.
start
()
t1
.
join
()
t2
.
join
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录