Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
3b6b0569
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看板
提交
3b6b0569
编写于
11月 19, 2020
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-1355] <test> add test case, fix queryInterval
上级
9b147cbd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
6 deletion
+26
-6
tests/pytest/query/queryInterval.py
tests/pytest/query/queryInterval.py
+20
-6
tests/pytest/tools/taosdemo.py
tests/pytest/tools/taosdemo.py
+6
-0
未找到文件。
tests/pytest/query/queryInterval.py
浏览文件 @
3b6b0569
...
...
@@ -32,30 +32,44 @@ class TDTestCase:
tdSql
.
execute
(
"insert into t0 using st tags('beijing') values(%d, 220) (%d, 221) (%d, 225) (%d, 228) (%d, 222)"
%
(
self
.
ts
,
self
.
ts
+
1000000000
,
self
.
ts
+
2000000000
,
self
.
ts
+
3000000000
,
self
.
ts
+
6000000000
))
tdSql
.
execute
(
"insert into t1 using st tags('shanghai') values(%d, 220) (%d, 221) (%d, 225) (%d, 228) (%d, 222)"
%
(
self
.
ts
,
self
.
ts
+
2000000000
,
self
.
ts
+
4000000000
,
self
.
ts
+
5000000000
,
self
.
ts
+
7000000000
))
%
(
self
.
ts
,
self
.
ts
+
2000000000
,
self
.
ts
+
4000000000
,
self
.
ts
+
5000000000
,
self
.
ts
+
7000000000
))
tdSql
.
query
(
"select avg(voltage) from st interval(1n)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
1
,
220.0
)
tdSql
.
checkData
(
1
,
1
,
222.33333333333334
)
tdSql
.
checkData
(
2
,
1
,
227.0
)
tdSql
.
checkData
(
3
,
1
,
222.0
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
"2020-07-01 00:00:00"
)
tdSql
.
checkData
(
0
,
1
,
221.4
)
tdSql
.
checkData
(
1
,
0
,
"2020-08-01 00:00:00"
)
tdSql
.
checkData
(
1
,
1
,
227.0
)
tdSql
.
checkData
(
2
,
0
,
"2020-09-01 00:00:00"
)
tdSql
.
checkData
(
2
,
1
,
222.0
)
tdSql
.
query
(
"select avg(voltage) from st interval(1n, 15d)"
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
"2020-06-16 00:00:00"
)
tdSql
.
checkData
(
0
,
1
,
220.333333
)
tdSql
.
checkData
(
1
,
0
,
"2020-07-16 00:00:00"
)
tdSql
.
checkData
(
1
,
1
,
224.666666
)
tdSql
.
checkData
(
2
,
0
,
"2020-08-16 00:00:00"
)
tdSql
.
checkData
(
2
,
1
,
225.0
)
tdSql
.
checkData
(
3
,
0
,
"2020-09-16 00:00:00"
)
tdSql
.
checkData
(
3
,
1
,
222.0
)
tdSql
.
query
(
"select avg(voltage) from st interval(1n, 15d) group by loc"
)
tdSql
.
checkRows
(
7
)
tdSql
.
checkData
(
0
,
0
,
"2020-06-16 00:00:00"
)
tdSql
.
checkData
(
0
,
1
,
220.5
)
tdSql
.
checkData
(
1
,
0
,
"2020-07-16 00:00:00"
)
tdSql
.
checkData
(
1
,
1
,
226.5
)
tdSql
.
checkData
(
2
,
0
,
"2020-08-16 00:00:00"
)
tdSql
.
checkData
(
2
,
1
,
222.0
)
tdSql
.
checkData
(
3
,
0
,
"2020-06-16 00:00:00"
)
tdSql
.
checkData
(
3
,
1
,
220.0
)
tdSql
.
checkData
(
4
,
0
,
"2020-07-16 00:00:00"
)
tdSql
.
checkData
(
4
,
1
,
221.0
)
tdSql
.
checkData
(
5
,
0
,
"2020-08-16 00:00:00"
)
tdSql
.
checkData
(
5
,
1
,
226.5
)
tdSql
.
checkData
(
6
,
0
,
"2020-09-16 00:00:00"
)
tdSql
.
checkData
(
6
,
1
,
222.0
)
def
stop
(
self
):
...
...
tests/pytest/tools/taosdemo.py
浏览文件 @
3b6b0569
...
...
@@ -55,6 +55,12 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
self
.
numberOfTables
*
self
.
numberOfRecords
)
tdSql
.
query
(
"select sum(f1) from test.meters interval(1h) sliding(30m)"
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select apercentile(f1, 1) from test.meters interval(10s)"
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录