Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3a08d3be
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3a08d3be
编写于
11月 03, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
上级
0b3a3aff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
133 addition
and
3 deletion
+133
-3
tests/system-test/2-query/countAlwaysReturnValue.py
tests/system-test/2-query/countAlwaysReturnValue.py
+125
-0
tests/system-test/2-query/hyperloglog.py
tests/system-test/2-query/hyperloglog.py
+1
-1
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+7
-2
未找到文件。
tests/system-test/2-query/countAlwaysReturnValue.py
0 → 100644
浏览文件 @
3a08d3be
import
taos
import
sys
import
datetime
import
inspect
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
import
random
class
TDTestCase
:
updatecfgDict
=
{
"countAlwaysReturnValue"
:
0
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
False
)
def
prepare_data
(
self
,
dbname
=
"db"
):
tdSql
.
execute
(
f
"create database if not exists
{
dbname
}
keep 3650 duration 1000"
)
tdSql
.
execute
(
f
"use
{
dbname
}
"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.tb (ts timestamp, c0 int)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.stb (ts timestamp, c0 int) tags (t0 int)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.ctb1 using
{
dbname
}
.stb tags (1)"
)
tdSql
.
execute
(
f
"create table
{
dbname
}
.ctb2 using
{
dbname
}
.stb tags (2)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.tb values (now(), NULL)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ctb1 values (now(), NULL)"
)
tdSql
.
execute
(
f
"insert into
{
dbname
}
.ctb2 values (now() + 1s, NULL)"
)
def
test_results
(
self
,
dbname
=
"db"
):
# count
tdSql
.
query
(
f
"select count(c0) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select count(NULL) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,count(c0) from
{
dbname
}
.tb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select count(c0) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select count(NULL) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,count(c0) from
{
dbname
}
.stb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select tbname,count(c0) from
{
dbname
}
.stb partition by tbname"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
1
,
None
)
tdSql
.
query
(
f
"select count(NULL)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
# hyperloglog
tdSql
.
query
(
f
"select hyperloglog(c0) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select hyperloglog(NULL) from
{
dbname
}
.tb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,hyperloglog(c0) from
{
dbname
}
.tb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select hyperloglog(c0) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select hyperloglog(NULL) from
{
dbname
}
.stb"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
f
"select c0,hyperloglog(c0) from
{
dbname
}
.stb group by c0"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
f
"select tbname,hyperloglog(c0) from
{
dbname
}
.stb partition by tbname"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
1
,
1
,
None
)
tdSql
.
query
(
f
"select hyperloglog(NULL)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
printNoPrefix
(
"==========step1:prepare data =============="
)
self
.
prepare_data
()
tdLog
.
printNoPrefix
(
"==========step2:test results =============="
)
self
.
test_results
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/2-query/hyperloglog.py
浏览文件 @
3a08d3be
...
...
@@ -28,7 +28,7 @@ ALL_COL = [ INT_COL, BINT_COL, SINT_COL, TINT_COL, FLOAT_COL, DOUBLE_COL, BOOL_C
DBNAME
=
"db"
class
TDTestCase
:
updatecfgDict
=
{
"maxTablesPerVnode"
:
2
,
"minTablesPerVnode"
:
2
,
"tableIncStepPerVnode"
:
2
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
...
...
tests/system-test/fulltest.sh
浏览文件 @
3a08d3be
...
...
@@ -17,7 +17,7 @@ python3 ./test.py -f 0-others/taosdShell.py -N 5 -M 3 -Q 3
python3 ./test.py
-f
0-others/sysinfo.py
python3 ./test.py
-f
0-others/user_control.py
python3 ./test.py
-f
0-others/fsync.py
python3 ./test.py
-f
0-others/compatibility.py
python3 ./test.py
-f
0-others/compatibility.py
python3 ./test.py
-f
1-insert/alter_database.py
python3 ./test.py
-f
1-insert/influxdb_line_taosc_insert.py
python3 ./test.py
-f
1-insert/opentsdb_telnet_line_taosc_insert.py
...
...
@@ -76,6 +76,8 @@ python3 ./test.py -f 2-query/count_partition.py
python3 ./test.py
-f
2-query/count_partition.py
-R
python3 ./test.py
-f
2-query/count.py
python3 ./test.py
-f
2-query/count.py
-R
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-R
python3 ./test.py
-f
2-query/db.py
python3 ./test.py
-f
2-query/db.py
-R
python3 ./test.py
-f
2-query/diff.py
...
...
@@ -383,6 +385,7 @@ python3 ./test.py -f 2-query/Today.py -Q 2
python3 ./test.py
-f
2-query/max.py
-Q
2
python3 ./test.py
-f
2-query/min.py
-Q
2
python3 ./test.py
-f
2-query/count.py
-Q
2
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
2
python3 ./test.py
-f
2-query/last.py
-Q
2
python3 ./test.py
-f
2-query/first.py
-Q
2
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
2
...
...
@@ -478,6 +481,7 @@ python3 ./test.py -f 2-query/Today.py -Q 3
python3 ./test.py
-f
2-query/max.py
-Q
3
python3 ./test.py
-f
2-query/min.py
-Q
3
python3 ./test.py
-f
2-query/count.py
-Q
3
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
3
python3 ./test.py
-f
2-query/last.py
-Q
3
python3 ./test.py
-f
2-query/first.py
-Q
3
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
3
...
...
@@ -575,6 +579,7 @@ python3 ./test.py -f 2-query/Today.py -Q 4
python3 ./test.py
-f
2-query/max.py
-Q
4
python3 ./test.py
-f
2-query/min.py
-Q
4
python3 ./test.py
-f
2-query/count.py
-Q
4
python3 ./test.py
-f
2-query/countAlwaysReturnValue.py
-Q
4
python3 ./test.py
-f
2-query/last.py
-Q
4
python3 ./test.py
-f
2-query/first.py
-Q
4
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
4
...
...
@@ -590,7 +595,7 @@ python3 ./test.py -f 2-query/apercentile.py -Q 4
python3 ./test.py
-f
2-query/abs.py
-Q
4
python3 ./test.py
-f
2-query/ceil.py
-Q
4
python3 ./test.py
-f
2-query/floor.py
-Q
4
python3 ./test.py
-f
2-query/round.py
-Q
4
python3 ./test.py
-f
2-query/round.py
-Q
4
python3 ./test.py
-f
2-query/log.py
-Q
4
python3 ./test.py
-f
2-query/pow.py
-Q
4
python3 ./test.py
-f
2-query/sqrt.py
-Q
4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录