Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f637ac29
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看板
提交
f637ac29
编写于
10月 27, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
teat: supplement muti-branch for testcase elapsed.py
上级
c5d95abb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
6 deletion
+40
-6
tests/system-test/2-query/elapsed.py
tests/system-test/2-query/elapsed.py
+40
-6
未找到文件。
tests/system-test/2-query/elapsed.py
浏览文件 @
f637ac29
...
@@ -86,13 +86,20 @@ class TDTestCase:
...
@@ -86,13 +86,20 @@ class TDTestCase:
'''
'''
return
return
def
prepare_data
(
self
):
def
prepare_db
(
self
,
dbname
,
vgroupVar
):
tdLog
.
info
(
" ====================================== prepare db =================================================="
)
tdSql
.
execute
(
'drop database if exists testdb ;'
)
tdSql
.
execute
(
'create database %s keep 36500 vgroups %d ;'
%
(
dbname
,
vgroupVar
))
def
prepare_data
(
self
,
dbname
):
tdLog
.
info
(
" ====================================== prepare data =================================================="
)
tdLog
.
info
(
" ====================================== prepare data =================================================="
)
tdSql
.
execute
(
'drop database if exists testdb ;'
)
#
tdSql.execute('drop database if exists testdb ;')
tdSql
.
execute
(
'create database testdb keep 36500;'
)
#
tdSql.execute('create database testdb keep 36500;')
tdSql
.
execute
(
'use
testdb;'
)
tdSql
.
execute
(
'use
%s;'
%
dbname
)
tdSql
.
execute
(
'create stable stable_1(ts timestamp ,tscol timestamp, q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint, q_float float ,
\
tdSql
.
execute
(
'create stable stable_1(ts timestamp ,tscol timestamp, q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint, q_float float ,
\
q_double double , bin_chars binary(20)) tags(loc nchar(20) ,ind int,tstag timestamp);'
)
q_double double , bin_chars binary(20)) tags(loc nchar(20) ,ind int,tstag timestamp);'
)
...
@@ -1317,6 +1324,13 @@ class TDTestCase:
...
@@ -1317,6 +1324,13 @@ class TDTestCase:
# # bug fix
# # bug fix
tdSql
.
error
(
"select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;"
)
tdSql
.
error
(
"select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;"
)
#TD-19911
tdSql
.
error
(
"select elapsed(ts,1s,123) from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
error
(
"select elapsed() from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
error
(
"select elapsed(tscol,1s) from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
error
(
"select elapsed(ts,1n) from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
error
(
"select elapsed(ts,1y) from (select ts,tbname from regular_table_1 order by ts asc );"
)
# case TD-12276
# case TD-12276
tdSql
.
query
(
"select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
query
(
"select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );"
)
tdSql
.
checkData
(
0
,
0
,
90.000000000
)
tdSql
.
checkData
(
0
,
0
,
90.000000000
)
...
@@ -1525,7 +1539,6 @@ class TDTestCase:
...
@@ -1525,7 +1539,6 @@ class TDTestCase:
def
query_precision
(
self
):
def
query_precision
(
self
):
def
generate_data
(
precision
=
"ms"
):
def
generate_data
(
precision
=
"ms"
):
tdSql
.
execute
(
"create database if not exists db_%s precision '%s';"
%
(
precision
,
precision
))
tdSql
.
execute
(
"create database if not exists db_%s precision '%s';"
%
(
precision
,
precision
))
tdSql
.
execute
(
"use db_%s;"
%
precision
)
tdSql
.
execute
(
"use db_%s;"
%
precision
)
tdSql
.
execute
(
"create stable db_%s.st (ts timestamp , id int) tags(ind int);"
%
precision
)
tdSql
.
execute
(
"create stable db_%s.st (ts timestamp , id int) tags(ind int);"
%
precision
)
...
@@ -1579,7 +1592,9 @@ class TDTestCase:
...
@@ -1579,7 +1592,9 @@ class TDTestCase:
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
self
.
prepare_data
()
dbNameTest
=
"testdbV1"
self
.
prepare_db
(
dbNameTest
,
1
)
self
.
prepare_data
(
dbNameTest
)
self
.
abnormal_common_test
()
self
.
abnormal_common_test
()
self
.
abnormal_use_test
()
self
.
abnormal_use_test
()
self
.
query_filter
()
self
.
query_filter
()
...
@@ -1596,6 +1611,25 @@ class TDTestCase:
...
@@ -1596,6 +1611,25 @@ class TDTestCase:
self
.
continuous_query
()
self
.
continuous_query
()
self
.
query_precision
()
self
.
query_precision
()
dbNameTest
=
"testdbV2"
self
.
prepare_db
(
dbNameTest
,
2
)
self
.
prepare_data
(
dbNameTest
)
self
.
abnormal_common_test
()
self
.
abnormal_use_test
()
self
.
query_filter
()
# self.query_interval()
self
.
query_mix_common
()
self
.
query_mix_Aggregate
()
self
.
query_mix_select
()
self
.
query_mix_compute
()
self
.
query_mix_arithmetic
()
# self.query_with_join()
# self.query_with_union()
self
.
query_nest
()
self
.
query_session_windows
()
self
.
continuous_query
()
# self.query_precision()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录