Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1e42bf61
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
1e42bf61
编写于
10月 24, 2022
作者:
H
Hui Li
提交者:
GitHub
10月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17591 from taosdata/test/TD-19596
Test/td 19596
上级
fdb6d2be
2b641af4
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
5515 addition
and
7320 deletion
+5515
-7320
tests/system-test/2-query/Today.py
tests/system-test/2-query/Today.py
+7
-1
tests/system-test/2-query/nestedQuery.py
tests/system-test/2-query/nestedQuery.py
+5207
-1583
tests/system-test/2-query/nestedQuery_math.py
tests/system-test/2-query/nestedQuery_math.py
+76
-0
tests/system-test/2-query/nestedQuery_str.py
tests/system-test/2-query/nestedQuery_str.py
+42
-5716
tests/system-test/2-query/nestedQuery_time.py
tests/system-test/2-query/nestedQuery_time.py
+76
-0
tests/system-test/2-query/stablity.py
tests/system-test/2-query/stablity.py
+8
-6
tests/system-test/2-query/stablity_1.py
tests/system-test/2-query/stablity_1.py
+73
-0
tests/system-test/2-query/timetruncate.py
tests/system-test/2-query/timetruncate.py
+19
-8
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+7
-6
未找到文件。
tests/system-test/2-query/Today.py
浏览文件 @
1e42bf61
...
...
@@ -43,7 +43,13 @@ class TDTestCase:
f
'today(),3,3.333,333.333333,now()'
,
f
'today()-1d,10,11.11,99.999999,now()'
,
f
'today()+1d,1,1.55,100.555555,today()'
]
self
.
db_percision
=
[
'ms'
,
'us'
,
'ns'
]
self
.
rest_tag
=
str
(
conn
).
lower
().
split
(
'.'
)[
0
].
replace
(
"<taos"
,
""
)
if
self
.
rest_tag
!=
'rest'
:
self
.
db_percision
=
[
'ms'
,
'us'
,
'ns'
]
else
:
self
.
db_percision
=
[
'ms'
,
'us'
]
def
set_create_normaltable_sql
(
self
,
ntbname
,
column_dict
):
column_sql
=
''
for
k
,
v
in
column_dict
.
items
():
...
...
tests/system-test/2-query/nestedQuery.py
浏览文件 @
1e42bf61
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
tests/system-test/2-query/nestedQuery_math.py
0 → 100755
浏览文件 @
1e42bf61
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from
util.cases
import
tdCases
from
.nestedQuery
import
*
class
TDTestCase
(
TDTestCase
):
def
run
(
self
):
tdSql
.
prepare
()
startTime
=
time
.
time
()
#self.function_before_26()
# self.math_nest(['UNIQUE'])
# self.math_nest(['MODE'])
# self.math_nest(['SAMPLE'])
self
.
math_nest
([
'ABS'
,
'SQRT'
])
self
.
math_nest
([
'SIN'
,
'COS'
,
'TAN'
,
'ASIN'
,
'ACOS'
,
'ATAN'
])
self
.
math_nest
([
'POW'
,
'LOG'
])
self
.
math_nest
([
'FLOOR'
,
'CEIL'
,
'ROUND'
])
self
.
math_nest
([
'MAVG'
])
self
.
math_nest
([
'HYPERLOGLOG'
])
self
.
math_nest
([
'TAIL'
])
self
.
math_nest
([
'CSUM'
])
self
.
math_nest
([
'statecount'
,
'stateduration'
])
self
.
math_nest
([
'HISTOGRAM'
])
# self.str_nest(['LTRIM','RTRIM','LOWER','UPPER'])
# self.str_nest(['LENGTH','CHAR_LENGTH'])
# self.str_nest(['SUBSTR'])
# self.str_nest(['CONCAT'])
# self.str_nest(['CONCAT_WS'])
# self.time_nest(['CAST']) #放到time里起来弄
# self.time_nest(['CAST_1'])
# self.time_nest(['CAST_2'])
# self.time_nest(['CAST_3'])
# self.time_nest(['CAST_4'])
# self.time_nest(['NOW','TODAY'])
# self.time_nest(['TIMEZONE'])
# self.time_nest(['TIMETRUNCATE'])
# self.time_nest(['TO_ISO8601'])
# self.time_nest(['TO_UNIXTIMESTAMP'])
# self.time_nest(['ELAPSED'])
# self.time_nest(['TIMEDIFF_1'])
# self.time_nest(['TIMEDIFF_2'])
endTime
=
time
.
time
()
print
(
"total time %ds"
%
(
endTime
-
startTime
))
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/2-query/nestedQuery_str.py
浏览文件 @
1e42bf61
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
tests/system-test/2-query/nestedQuery_time.py
0 → 100755
浏览文件 @
1e42bf61
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from
util.cases
import
tdCases
from
.nestedQuery
import
*
class
TDTestCase
(
TDTestCase
):
def
run
(
self
):
tdSql
.
prepare
()
startTime
=
time
.
time
()
# self.function_before_26()
# self.math_nest(['UNIQUE'])
# self.math_nest(['MODE'])
# self.math_nest(['SAMPLE'])
# self.math_nest(['ABS','SQRT'])
# self.math_nest(['SIN','COS','TAN','ASIN','ACOS','ATAN'])
# self.math_nest(['POW','LOG'])
# self.math_nest(['FLOOR','CEIL','ROUND'])
# self.math_nest(['MAVG'])
# self.math_nest(['HYPERLOGLOG'])
# self.math_nest(['TAIL'])
# self.math_nest(['CSUM'])
# self.math_nest(['statecount','stateduration'])
# self.math_nest(['HISTOGRAM'])
# self.str_nest(['LTRIM','RTRIM','LOWER','UPPER'])
# self.str_nest(['LENGTH','CHAR_LENGTH'])
# self.str_nest(['SUBSTR'])
# self.str_nest(['CONCAT'])
# self.str_nest(['CONCAT_WS'])
# self.time_nest(['CAST']) #放到time里起来弄
# self.time_nest(['CAST_1'])
# self.time_nest(['CAST_2'])
# self.time_nest(['CAST_3'])
# self.time_nest(['CAST_4'])
self
.
time_nest
([
'NOW'
,
'TODAY'
])
self
.
time_nest
([
'TIMEZONE'
])
self
.
time_nest
([
'TIMETRUNCATE'
])
self
.
time_nest
([
'TO_ISO8601'
])
self
.
time_nest
([
'TO_UNIXTIMESTAMP'
])
self
.
time_nest
([
'ELAPSED'
])
#self.time_nest(['TIMEDIFF_1'])
#self.time_nest(['TIMEDIFF_2'])
endTime
=
time
.
time
()
print
(
"total time %ds"
%
(
endTime
-
startTime
))
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/2-query/stablity.py
浏览文件 @
1e42bf61
...
...
@@ -39,7 +39,7 @@ class TDTestCase:
self
.
num
=
10
self
.
fornum
=
5
self
.
db_nest
=
"
nest
"
self
.
db_nest
=
"
stab
"
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
# regular column select
...
...
@@ -780,7 +780,7 @@ class TDTestCase:
print
(
"==========%s===start============="
%
mathlist
)
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
#
self.dropandcreateDB_random("%s" %self.db_nest, 1)
if
(
mathlist
==
[
'ABS'
,
'SQRT'
])
or
(
mathlist
==
[
'SIN'
,
'COS'
,
'TAN'
,
'ASIN'
,
'ACOS'
,
'ATAN'
])
or
(
mathlist
==
[
'FLOOR'
,
'CEIL'
,
'ROUND'
])
\
or
(
mathlist
==
[
'CSUM'
])
:
...
...
@@ -842,7 +842,7 @@ class TDTestCase:
elif
(
mathlist
==
[
'POW'
,
'LOG'
])
or
(
mathlist
==
[
'MAVG'
])
or
(
mathlist
==
[
'SAMPLE'
])
:
math_functions
=
mathlist
num
=
random
.
randint
(
0
,
1000
)
num
=
random
.
randint
(
1
,
1000
)
fun_fix_column
=
[
'(q_bigint,num)'
,
'(q_smallint,num)'
,
'(q_tinyint,num)'
,
'(q_int,num)'
,
'(q_float,num)'
,
'(q_double,num)'
,
'(q_bigint_null,num)'
,
'(q_smallint_null,num)'
,
'(q_tinyint_null,num)'
,
'(q_int_null,num)'
,
'(q_float_null,num)'
,
'(q_double_null,num)'
]
fun_column_1
=
random
.
sample
(
math_functions
,
1
)
+
random
.
sample
(
fun_fix_column
,
1
)
...
...
@@ -1470,7 +1470,7 @@ class TDTestCase:
print
(
"==========%s===start============="
%
strlist
)
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
#
self.dropandcreateDB_random("%s" %self.db_nest, 1)
if
(
strlist
==
[
'LTRIM'
,
'RTRIM'
,
'LOWER'
,
'UPPER'
])
or
(
strlist
==
[
'LENGTH'
,
'CHAR_LENGTH'
])
\
or
(
strlist
==
[
''
]):
...
...
@@ -2206,7 +2206,7 @@ class TDTestCase:
print
(
"==========%s===start============="
%
timelist
)
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
#
self.dropandcreateDB_random("%s" %self.db_nest, 1)
if
(
timelist
==
[
'NOW'
,
'TODAY'
])
or
(
timelist
==
[
'TIMEZONE'
]):
time_functions
=
timelist
...
...
@@ -4881,7 +4881,9 @@ class TDTestCase:
startTime
=
time
.
time
()
self
.
function_before_26
()
#self.function_before_26()
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
self
.
math_nest
([
'UNIQUE'
])
self
.
math_nest
([
'MODE'
])
...
...
tests/system-test/2-query/stablity_1.py
0 → 100755
浏览文件 @
1e42bf61
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
from
util.cases
import
tdCases
from
.stablity
import
*
class
TDTestCase
(
TDTestCase
):
def
run
(
self
):
tdSql
.
prepare
()
startTime
=
time
.
time
()
self
.
function_before_26
()
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db_nest
,
1
)
# self.math_nest(['UNIQUE'])
# self.math_nest(['MODE'])
# self.math_nest(['SAMPLE'])
# self.math_nest(['ABS','SQRT'])
# self.math_nest(['SIN','COS','TAN','ASIN','ACOS','ATAN'])
# self.math_nest(['POW','LOG'])
# self.math_nest(['FLOOR','CEIL','ROUND'])
# self.math_nest(['MAVG'])
# self.math_nest(['HYPERLOGLOG'])
# self.math_nest(['TAIL'])
# self.math_nest(['CSUM'])
# self.math_nest(['statecount','stateduration'])
# self.math_nest(['HISTOGRAM'])
self
.
str_nest
([
'LTRIM'
,
'RTRIM'
,
'LOWER'
,
'UPPER'
])
self
.
str_nest
([
'LENGTH'
,
'CHAR_LENGTH'
])
self
.
str_nest
([
'SUBSTR'
])
self
.
str_nest
([
'CONCAT'
])
self
.
str_nest
([
'CONCAT_WS'
])
self
.
time_nest
([
'CAST'
])
self
.
time_nest
([
'CAST_1'
])
self
.
time_nest
([
'CAST_2'
])
self
.
time_nest
([
'CAST_3'
])
self
.
time_nest
([
'CAST_4'
])
self
.
time_nest
([
'NOW'
,
'TODAY'
])
self
.
time_nest
([
'TIMEZONE'
])
self
.
time_nest
([
'TIMETRUNCATE'
])
self
.
time_nest
([
'TO_ISO8601'
])
self
.
time_nest
([
'TO_UNIXTIMESTAMP'
])
self
.
time_nest
([
'ELAPSED'
])
self
.
time_nest
([
'TIMEDIFF_1'
])
self
.
time_nest
([
'TIMEDIFF_2'
])
endTime
=
time
.
time
()
print
(
"total time %ds"
%
(
endTime
-
startTime
))
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/2-query/timetruncate.py
浏览文件 @
1e42bf61
...
...
@@ -10,6 +10,9 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
print
(
conn
)
self
.
rest_tag
=
str
(
conn
).
lower
().
split
(
'.'
)[
0
].
replace
(
"<taos"
,
""
)
print
(
self
.
rest_tag
)
self
.
get_time
=
GetTime
()
self
.
ts_str
=
[
'2020-1-1'
,
...
...
@@ -85,28 +88,36 @@ class TDTestCase:
def
check_ns_timestamp
(
self
,
unit
,
date_time
):
if
unit
.
lower
()
==
'1b'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]))
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]))
elif
unit
.
lower
()
==
'1u'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
)
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
)
*
1000
)
elif
unit
.
lower
()
==
'1a'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
)
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
)
*
1000
*
1000
)
elif
unit
.
lower
()
==
'1s'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
)
*
1000
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
)
*
1000
*
1000
*
1000
)
elif
unit
.
lower
()
==
'1m'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
)
*
60
*
1000
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
)
*
60
*
1000
*
1000
*
1000
)
elif
unit
.
lower
()
==
'1h'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
)
*
60
*
60
*
1000
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
)
*
60
*
60
*
1000
*
1000
*
1000
)
elif
unit
.
lower
()
==
'1d'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
/
24
)
*
24
*
60
*
60
*
1000
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
/
24
)
*
24
*
60
*
60
*
1000
*
1000
*
1000
)
elif
unit
.
lower
()
==
'1w'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
/
24
/
7
)
*
7
*
24
*
60
*
60
*
1000
*
1000
*
1000
)
if
self
.
rest_tag
!=
'rest'
:
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
/
1000
/
1000
/
60
/
60
/
24
/
7
)
*
7
*
24
*
60
*
60
*
1000
*
1000
*
1000
)
def
check_tb_type
(
self
,
unit
,
tb_type
):
if
tb_type
.
lower
()
==
'ntb'
:
...
...
tests/system-test/fulltest.sh
浏览文件 @
1e42bf61
...
...
@@ -179,7 +179,7 @@ python3 ./test.py -f 2-query/tan.py -R
python3 ./test.py
-f
2-query/Timediff.py
python3 ./test.py
-f
2-query/Timediff.py
-R
python3 ./test.py
-f
2-query/timetruncate.py
#
python3 ./test.py -f 2-query/timetruncate.py -R
python3 ./test.py
-f
2-query/timetruncate.py
-R
python3 ./test.py
-f
2-query/timezone.py
python3 ./test.py
-f
2-query/timezone.py
-R
python3 ./test.py
-f
2-query/To_iso8601.py
...
...
@@ -187,7 +187,7 @@ python3 ./test.py -f 2-query/To_iso8601.py -R
python3 ./test.py
-f
2-query/To_unixtimestamp.py
python3 ./test.py
-f
2-query/To_unixtimestamp.py
-R
python3 ./test.py
-f
2-query/Today.py
#
python3 ./test.py -f 2-query/Today.py -R
python3 ./test.py
-f
2-query/Today.py
-R
python3 ./test.py
-f
2-query/top.py
python3 ./test.py
-f
2-query/top.py
-R
python3 ./test.py
-f
2-query/tsbsQuery.py
...
...
@@ -217,11 +217,12 @@ python3 ./test.py -f 2-query/concat2.py
python3 ./test.py
-f
2-query/json_tag.py
#
python3 ./test.py -f 2-query/nestedQuery.py
# TD-15983 subquery output duplicate name column.
# Please Xiangyang Guo modify the following script
# python3 ./test.py -f 2-query/nestedQuery_str
.py
python3 ./test.py
-f
2-query/nestedQuery.py
python3 ./test.py
-f
2-query/nestedQuery_str.py
python3 ./test.py
-f
2-query/nestedQuery_math.py
python3 ./test.py
-f
2-query/nestedQuery_time
.py
python3 ./test.py
-f
2-query/stablity.py
python3 ./test.py
-f
2-query/stablity_1.py
python3 ./test.py
-f
2-query/elapsed.py
python3 ./test.py
-f
2-query/csum.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录