Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
电商架构修炼
TDengine
提交
2bb9cfa7
TDengine
项目概览
电商架构修炼
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
2bb9cfa7
编写于
8月 26, 2021
作者:
H
Hui Li
提交者:
GitHub
8月 26, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7577 from taosdata/test/fix-4288
fix the show varibels case
上级
668258c2
0bf76990
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
68 addition
and
17 deletion
+68
-17
tests/pytest/functions/queryTestCases.py
tests/pytest/functions/queryTestCases.py
+56
-16
tests/pytest/functions/showOfflineThresholdIs864000.py
tests/pytest/functions/showOfflineThresholdIs864000.py
+12
-1
未找到文件。
tests/pytest/functions/queryTestCases.py
浏览文件 @
2bb9cfa7
...
...
@@ -15,6 +15,7 @@ import sys
import
subprocess
import
random
import
math
import
numpy
as
np
from
util.log
import
*
from
util.cases
import
*
...
...
@@ -57,16 +58,33 @@ class TDTestCase:
def
td3690
(
self
):
tdLog
.
printNoPrefix
(
"==========TD-3690=========="
)
tdSql
.
prepare
()
tdSql
.
execute
(
"show variables"
)
res_off
=
tdSql
.
cursor
.
fetchall
()
resList
=
np
.
array
(
res_off
)
index
=
np
.
where
(
resList
==
"offlineThreshold"
)
index_value
=
np
.
dstack
((
index
[
0
])).
squeeze
()
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
53
,
1
,
864000
)
tdSql
.
checkData
(
index_value
,
1
,
864000
)
def
td4082
(
self
):
tdLog
.
printNoPrefix
(
"==========TD-4082=========="
)
tdSql
.
prepare
()
cfgfile
=
self
.
getCfgFile
()
max_compressMsgSize
=
100000000
tdSql
.
execute
(
"show variables"
)
res_com
=
tdSql
.
cursor
.
fetchall
()
rescomlist
=
np
.
array
(
res_com
)
cpms_index
=
np
.
where
(
rescomlist
==
"compressMsgSize"
)
index_value
=
np
.
dstack
((
cpms_index
[
0
])).
squeeze
()
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
26
,
1
,
-
1
)
tdSql
.
checkData
(
index_value
,
1
,
-
1
)
tdSql
.
query
(
"show dnodes"
)
index
=
tdSql
.
getData
(
0
,
0
)
...
...
@@ -80,7 +98,7 @@ class TDTestCase:
tdDnodes
.
start
(
index
)
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
26
,
1
,
100000000
)
tdSql
.
checkData
(
index_value
,
1
,
100000000
)
tdDnodes
.
stop
(
index
)
cmd
=
f
"sed -i '$s/
{
max_compressMsgSize
}
/
{
max_compressMsgSize
+
10
}
/g'
{
cfgfile
}
"
...
...
@@ -91,7 +109,7 @@ class TDTestCase:
tdDnodes
.
start
(
index
)
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
26
,
1
,
-
1
)
tdSql
.
checkData
(
index_value
,
1
,
-
1
)
tdDnodes
.
stop
(
index
)
cmd
=
f
"sed -i '$d'
{
cfgfile
}
"
...
...
@@ -104,8 +122,12 @@ class TDTestCase:
def
td4097
(
self
):
tdLog
.
printNoPrefix
(
"==========TD-4097=========="
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"drop database if exists db1"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
"create database if not exists db keep 3650"
)
tdSql
.
execute
(
"create database if not exists db1 keep 3650"
)
tdSql
.
execute
(
"create database if not exists new keep 3650"
)
...
...
@@ -267,10 +289,22 @@ class TDTestCase:
# keep ~ [days,365000]
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db"
)
tdSql
.
execute
(
"show variables"
)
res_kp
=
tdSql
.
cursor
.
fetchall
()
resList
=
np
.
array
(
res_kp
)
keep_index
=
np
.
where
(
resList
==
"keep"
)
index_value
=
np
.
dstack
((
keep_index
[
0
])).
squeeze
()
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
38
,
1
,
3650
)
tdSql
.
checkData
(
index_value
,
1
,
3650
)
tdSql
.
query
(
"show databases"
)
tdSql
.
checkData
(
0
,
7
,
"3650,3650,3650"
)
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
tdSql
.
checkData
(
0
,
7
,
"3650,3650,3650"
)
else
:
tdSql
.
checkData
(
0
,
7
,
3650
)
days
=
tdSql
.
getData
(
0
,
6
)
tdSql
.
error
(
"alter database db keep 3650001"
)
...
...
@@ -289,14 +323,22 @@ class TDTestCase:
tdSql
.
execute
(
"alter database db keep 36500"
)
tdSql
.
query
(
"show databases"
)
tdSql
.
checkData
(
0
,
7
,
"3650,3650,36500"
)
if
(
"community"
in
selfPath
):
tdSql
.
checkData
(
0
,
7
,
"36500,36500,36500"
)
else
:
tdSql
.
checkData
(
0
,
7
,
36500
)
tdSql
.
execute
(
"drop database if exists db"
)
tdSql
.
execute
(
"create database if not exists db1"
)
tdSql
.
query
(
"show databases"
)
tdSql
.
checkData
(
0
,
7
,
"3650,3650,3650"
)
if
(
"community"
in
selfPath
):
tdSql
.
checkData
(
0
,
7
,
"3650,3650,3650"
)
else
:
tdSql
.
checkData
(
0
,
7
,
3650
)
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
38
,
1
,
3650
)
tdSql
.
checkData
(
index_value
,
1
,
3650
)
tdSql
.
execute
(
"alter database db1 keep 365"
)
tdSql
.
execute
(
"drop database if exists db1"
)
...
...
@@ -697,10 +739,8 @@ class TDTestCase:
tdSql
.
checkRows
(
tbnum
*
3
)
tdSql
.
query
(
f
"select distinct c1 c2, c2 c3 from t1 where c1 <
{
tbnum
}
"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select distinct c1, c2 from stb1 order by ts"
)
tdSql
.
checkRows
(
tbnum
*
3
+
1
)
tdSql
.
query
(
"select distinct c1, c2 from t1 order by ts"
)
tdSql
.
checkRows
(
4
)
tdSql
.
error
(
"select distinct c1, c2 from stb1 order by ts"
)
tdSql
.
error
(
"select distinct c1, c2 from t1 order by ts"
)
tdSql
.
error
(
"select distinct c1, ts from stb1 group by c2"
)
tdSql
.
error
(
"select distinct c1, ts from t1 group by c2"
)
tdSql
.
error
(
"select distinct c1, max(c2) from stb1 "
)
...
...
@@ -1085,9 +1125,9 @@ class TDTestCase:
def
run
(
self
):
# master branch
#
self.td3690()
#
self.td4082()
#
self.td4288()
self
.
td3690
()
self
.
td4082
()
self
.
td4288
()
# self.td4724()
# self.td5798()
# self.td5935()
...
...
tests/pytest/functions/showOfflineThresholdIs864000.py
浏览文件 @
2bb9cfa7
...
...
@@ -12,6 +12,8 @@
# -*- coding: utf-8 -*-
import
sys
import
numpy
as
np
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
...
...
@@ -24,8 +26,17 @@ class TDTestCase:
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
# tdSql.query("show variables")
# tdSql.checkData(54, 1, 864000)
tdSql
.
execute
(
"show variables"
)
res
=
tdSql
.
cursor
.
fetchall
()
resList
=
np
.
array
(
res
)
index
=
np
.
where
(
resList
==
"offlineThreshold"
)
index_value
=
np
.
dstack
((
index
[
0
])).
squeeze
()
tdSql
.
query
(
"show variables"
)
tdSql
.
checkData
(
54
,
1
,
864000
)
tdSql
.
checkData
(
index_value
,
1
,
864000
)
pass
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录