Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
eea679a7
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
未验证
提交
eea679a7
编写于
11月 30, 2021
作者:
H
Hui Li
提交者:
GitHub
11月 30, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8833 from taosdata/test/windows_input_too_long
[TS-748]<test>fix windows input limit
上级
2b58431d
811a32dc
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
215 addition
and
4 deletion
+215
-4
deps/avro
deps/avro
+1
-0
deps/googletest
deps/googletest
+1
-0
deps/rocksdb
deps/rocksdb
+1
-0
deps/zlib
deps/zlib
+1
-0
src/connector/go
src/connector/go
+1
-1
src/connector/grafanaplugin
src/connector/grafanaplugin
+1
-1
src/connector/hivemq-tdengine-extension
src/connector/hivemq-tdengine-extension
+1
-1
src/plugins/blm3
src/plugins/blm3
+1
-0
src/plugins/taosadapter
src/plugins/taosadapter
+1
-0
tests/pytest/fulltest.bat
tests/pytest/fulltest.bat
+2
-1
tests/pytest/tools/windows_input.py
tests/pytest/tools/windows_input.py
+79
-0
tests/pytest/tt.py
tests/pytest/tt.py
+125
-0
未找到文件。
avro
@
a1fce29d
Subproject commit a1fce29d9675b4dd95dfee9db32cc505d0b2227c
googletest
@
e2239ee6
Subproject commit e2239ee6043f73722e7aa812a459f54a28552929
rocksdb
@
c3034fce
Subproject commit c3034fce329017036c807e01261729bfc11a5d62
zlib
@
cacf7f1d
Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f
go
@
b8f76da4
比较
050667e5
...
b8f76da4
Subproject commit
050667e5b4d0eafa5387e4283e713559b421203f
Subproject commit
b8f76da4a708d158ec3cc4b844571dc4414e36b4
grafanaplugin
@
792ef7c3
比较
72ecc6d6
...
792ef7c3
Subproject commit 7
2ecc6d636453c6a9b71d78d3edce385165cc35f
Subproject commit 7
92ef7c3036f15068796e09883d3f4d47a038fe2
hivemq-tdengine-extension
@
ce520101
比较
b62a26ec
...
ce520101
Subproject commit
b62a26ecc164a310104df57691691b237e091c89
Subproject commit
ce5201014136503d34fecbd56494b67b4961056c
blm3
@
f56aa0f4
Subproject commit f56aa0f485d7bb6aebbcefc2007eeecdccb767c8
taosadapter
@
6397bf59
Subproject commit 6397bf5963f62f0aa5c4b9b961b16ed5c62579f1
tests/pytest/fulltest.bat
浏览文件 @
eea679a7
...
...
@@ -18,4 +18,5 @@ python .\test.py -f query\filterAllIntTypes.py
python
.\test.py
-f
query
\filterFloatAndDouble.py
python
.\test.py
-f
query
\filterOtherTypes.py
python
.\test.py
-f
query
\querySort.py
python
.\test.py
-f
query
\queryJoin.py
\ No newline at end of file
python
.\test.py
-f
query
\queryJoin.py
python
.\test.py
-f
tools
\windows_input.py
\ No newline at end of file
tests/pytest/tools/windows_input.py
0 → 100644
浏览文件 @
eea679a7
###################################################################
# 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 -*-
import
os
from
uiautomation
import
WindowControl
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
self
.
host
=
conn
.
_host
def
win_input_test
(
self
):
os
.
system
(
"start"
)
time
.
sleep
(
1
)
# 获取CMD窗口
# window = DocumentControl(searchDepth=3, Name='Text Area')
window
=
WindowControl
(
searchDepth
=
1
,
AutomationId
=
'Console Window'
)
# 切换英文输入法
# window.SendKeys('\\')
# window.SendKeys('{Enter}')
# window.SendKeys('{Shift}')
# window.SendKeys('\\')
# window.SendKeys('{Enter}')
# 切换目录
window
.
SendKeys
(
'c:'
)
window
.
SendKeys
(
'{Enter}'
)
window
.
SendKeys
(
'cd
\\
'
)
window
.
SendKeys
(
'{Enter}'
)
window
.
SendKeys
(
'cd c:
\\
TDengine'
)
window
.
SendKeys
(
'{Enter}'
)
# 启动taos.exe
window
.
SendKeys
(
'taos.exe -h %s || taos.exe'
%
(
self
.
host
))
window
.
SendKeys
(
'{Enter}'
)
# 输入
temp
=
''
for
i
in
range
(
300
):
temp
+=
'a'
sql
=
"insert into db.tb values(now,'%s');"
%
temp
window
.
SendKeys
(
sql
)
window
.
SendKeys
(
'{Enter}'
)
window
.
SendKeys
(
'{Ctrl}C'
)
window
.
SendKeys
(
'exit'
)
window
.
SendKeys
(
'{Enter}'
)
def
run
(
self
):
tdSql
.
prepare
()
ret
=
tdSql
.
execute
(
'create table tb (ts timestamp, i binary(300))'
)
self
.
win_input_test
()
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/tt.py
0 → 100644
浏览文件 @
eea679a7
###################################################################
# 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 -*-
import
threading
import
taos
import
sys
import
json
import
time
import
random
import
requests
import
argparse
import
datetime
import
string
from
requests.auth
import
HTTPBasicAuth
class
CompressTest
:
# def __init__(self,ts=1500000001000,host='127.0.0.1',user='root',password='taosdata',dbname='test',
# stb_prefix='st',subtb_prefix='t',n_Therads=10,r_Therads=10,probabilities=0.05,loop=5,
# stableNum = 2,subtableNum = 1000,insertRows = 100):
def
__init__
(
self
):
self
.
host
=
'vm95'
self
.
ts
=
1569859200000
self
.
dbname
=
'db'
self
.
user
=
'root'
self
.
password
=
'taosdata'
self
.
loop
=
6
def
rest_query
(
self
,
sql
):
#rest 接口
host
=
self
.
host
user
=
self
.
user
password
=
self
.
password
port
=
6041
url
=
"http://{}:{}/rest/sql"
.
format
(
host
,
port
)
try
:
r
=
requests
.
post
(
url
,
data
=
'use %s'
%
self
.
dbname
,
auth
=
HTTPBasicAuth
(
'root'
,
'taosdata'
))
r
=
requests
.
post
(
url
,
data
=
sql
,
auth
=
HTTPBasicAuth
(
'root'
,
'taosdata'
))
except
:
print
(
"REST API Failure (TODO: more info here)"
)
raise
rj
=
r
.
json
()
if
(
'status'
not
in
rj
):
raise
RuntimeError
(
"No status in REST response"
)
if
rj
[
'status'
]
==
'error'
:
# clearly reported error
if
(
'code'
not
in
rj
):
# error without code
raise
RuntimeError
(
"REST error return without code"
)
errno
=
rj
[
'code'
]
# May need to massage this in the future
# print("Raising programming error with REST return: {}".format(rj))
raise
taos
.
error
.
ProgrammingError
(
rj
[
'desc'
],
errno
)
# todo: check existance of 'desc'
if
rj
[
'status'
]
!=
'succ'
:
# better be this
raise
RuntimeError
(
"Unexpected REST return status: {}"
.
format
(
rj
[
'status'
]))
nRows
=
rj
[
'rows'
]
if
(
'rows'
in
rj
)
else
0
return
nRows
def
query_thread_n
(
self
,
threadID
):
#使用原生python接口查询
tstart
=
time
.
time
()
host
=
self
.
host
user
=
self
.
user
password
=
self
.
password
conn
=
taos
.
connect
(
host
,
user
,
password
,
)
cl
=
conn
.
cursor
()
cl
.
execute
(
"use %s;"
%
self
.
dbname
)
print
(
"Thread %d: starting"
%
threadID
)
loop
=
self
.
loop
for
loop
in
range
(
7
):
ts
=
1569859200000
+
loop
*
86400000
try
:
# sql = 'select ts,c0 from stb_%d where ts >%d and ts <%d' % (threadID, ts, ts+86400000)
sql
=
'select ts,c1 from stb_%d where ts >%d and ts <%d'
%
(
threadID
,
ts
,
ts
+
86400000
)
# print("sql is ",sql)
# start = time.time()
cl
.
execute
(
sql
)
cl
.
fetchall
()
# end = time.time()
# print("time cost :",end-start)
except
Exception
as
e
:
print
(
'-'
*
40
)
print
(
"Failure thread%d, sql: %s
\n
exception: %s"
%
(
threadID
,
str
(
sql
),
str
(
e
)))
err_uec
=
'Unable to establish connection'
if
err_uec
in
str
(
e
)
and
loop
>
0
:
exit
(
-
1
)
cl
.
close
()
conn
.
close
()
tstop
=
time
.
time
()
print
(
"Thread %d: finishing, time collaps:%d "
%
(
threadID
,
tstop
-
tstart
))
def
run
(
self
):
threads
=
[]
for
i
in
range
(
10
):
thread
=
threading
.
Thread
(
target
=
self
.
query_thread_n
,
args
=
(
i
,))
threads
.
append
(
thread
)
thread
.
start
()
# for i in range(1,11):
# thread = threading.Thread(target=self.query_thread_r, args=(i,))
# threads.append(thread)
# thread.start()
q
=
CompressTest
()
q
.
run
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录