Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
c4eed9ec
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4eed9ec
编写于
4月 25, 2020
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
expose more info if case failed.
上级
46a7c3c9
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
338 addition
and
8 deletion
+338
-8
.travis.yml
.travis.yml
+1
-1
tests/pytest/insert/float.py
tests/pytest/insert/float.py
+147
-0
tests/pytest/insert/int.py
tests/pytest/insert/int.py
+184
-0
tests/pytest/test.py
tests/pytest/test.py
+1
-4
tests/pytest/util/cases.py
tests/pytest/util/cases.py
+1
-1
tests/test-all.sh
tests/test-all.sh
+4
-2
未找到文件。
.travis.yml
浏览文件 @
c4eed9ec
...
...
@@ -64,7 +64,7 @@ matrix:
memError=`grep -m 1 'ERROR SUMMARY' mem-error-out.txt | awk '{print $4}'`
if [ -n "$memError" ]; then
if [ "$memError" -gt 16 ]
&&
[ "$defiMemError" -gt 0 ]; then
if [ "$memError" -gt 16 ]
||
[ "$defiMemError" -gt 0 ]; then
echo -e "${RED} ## Memory errors number valgrind reports is $memError.\
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
travis_terminate $memError
...
...
tests/pytest/insert/float.py
0 → 100644
浏览文件 @
c4eed9ec
###################################################################
# 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
sys
import
datetime
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
info
(
"=============== step1"
)
cmd
=
'create table tb (ts timestamp, speed float)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
'insert into tb values (now, -3.40E+38)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdLog
.
info
(
"=============== step2"
)
cmd
=
'insert into tb values (now+1a, 3.40E+308)'
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
'select * from tb order by ts desc'
tdLog
.
info
(
cmd
)
tdSql
.
query
(
cmd
)
tdSql
.
checkRows
(
1
)
tdLog
.
info
(
"=============== step3"
)
cmd
=
"insert into tb values (now+2a, 2.85)"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
"select * from tb order by ts desc"
tdLog
.
info
(
cmd
)
ret
=
tdSql
.
query
(
cmd
)
tdSql
.
checkRows
(
2
)
if
((
abs
(
tdSql
.
getData
(
0
,
1
)
-
2.850000
))
>
1.0e-7
):
tdLog
.
exit
(
"data is not 2.850000"
)
tdLog
.
info
(
"=============== step4"
)
cmd
=
"insert into tb values (now+3a, 3.4)"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
"select * from tb order by ts desc"
tdLog
.
info
(
cmd
)
tdSql
.
query
(
cmd
)
tdSql
.
checkRows
(
3
)
if
(
abs
(
tdSql
.
getData
(
0
,
1
)
-
3.400000
)
>
1.0e-7
):
tdLog
.
exit
(
"data is not 3.400000"
)
tdLog
.
info
(
"=============== step5"
)
cmd
=
"insert into tb values (now+4a, a2)"
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed:
\
insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+4a, 0)"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
"select * from tb order by ts desc"
tdLog
.
info
(
cmd
)
tdSql
.
query
(
cmd
)
tdSql
.
checkRows
(
4
)
if
(
abs
(
tdSql
.
getData
(
0
,
1
)
-
0.000000
)
!=
0
):
tdLog
.
exit
(
"data is not 0.000000"
)
tdLog
.
info
(
"=============== step6"
)
cmd
=
"insert into tb values (now+5a, 2a)"
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+5a, 2)"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
"select * from tb order by ts desc"
tdLog
.
info
(
cmd
)
ret
=
tdSql
.
query
(
cmd
)
tdSql
.
checkRows
(
5
)
if
(
abs
(
tdSql
.
getData
(
0
,
1
)
-
2.000000
)
>
1.0e-7
):
tdLog
.
info
(
"data is not 2.000000"
)
tdLog
.
info
(
"=============== step7"
)
cmd
=
"insert into tb values (now+6a, 2a'1)"
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+6a, 2)"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
cmd
=
"select * from tb order by ts desc"
tdLog
.
info
(
cmd
)
tdSql
.
query
(
cmd
)
if
(
abs
(
tdSql
.
getData
(
0
,
1
)
-
2.000000
)
>
1.0e-7
):
tdLog
.
exit
(
"data is not 2.000000"
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/insert/int.py
0 → 100644
浏览文件 @
c4eed9ec
###################################################################
# 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
sys
import
taos
import
datetime
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
info
(
"=============== step1"
)
tdSql
.
execute
(
'create table tb (ts timestamp, speed int)'
)
cmd
=
'insert into tb values (now, NULL)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
1
)
if
(
tdSql
.
getData
(
0
,
1
)
is
not
None
):
tdLog
.
exit
(
"data is not NULL"
)
tdLog
.
info
(
"=============== step2"
)
cmd
=
'insert into tb values (now+1m, -2147483648)'
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: INT data overflow error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"INT data overflow error catched"
)
cmd
=
'insert into tb values (now+1m, NULL)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
2
)
if
(
tdSql
.
getData
(
0
,
1
)
is
not
None
):
tdLog
.
exit
(
"data is not NULL"
)
tdLog
.
info
(
"=============== step3"
)
cmd
=
'insert into tb values (now+2m, 2147483647)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
3
)
if
(
tdSql
.
getData
(
0
,
1
)
!=
2147483647
):
tdLog
.
exit
(
"data is not 2147483647"
)
tdLog
.
info
(
"=============== step4"
)
cmd
=
'insert into tb values (now+3m, 2147483648)'
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: INT data overflow error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"INT data overflow error catched"
)
cmd
=
'insert into tb values (now+3m, NULL)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
4
)
if
(
tdSql
.
getData
(
0
,
1
)
is
not
None
):
tdLog
.
exit
(
"data is not NULL"
)
tdLog
.
info
(
"=============== step5"
)
cmd
=
'insert into tb values (now+4m, a2)'
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+4m, 0)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
5
)
if
(
tdSql
.
getData
(
0
,
1
)
!=
0
):
tdLog
.
exit
(
"data is not 0"
)
tdLog
.
info
(
"=============== step6"
)
cmd
=
'insert into tb values (now+5m, 2a)'
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+5m, 2)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
6
)
if
(
tdSql
.
getData
(
0
,
1
)
!=
2
):
tdLog
.
exit
(
"data is not 2"
)
tdLog
.
info
(
"=============== step7"
)
cmd
=
"insert into tb values (now+6m, 2a'1)"
tdLog
.
info
(
cmd
)
try
:
tdSql
.
execute
(
cmd
)
tdLog
.
exit
(
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+6m, 2)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
7
)
if
(
tdSql
.
getData
(
0
,
1
)
!=
2
):
tdLog
.
exit
(
"data is not 2"
)
tdLog
.
info
(
"=============== step8"
)
cmd
=
'insert into tb values (now+8m, "null")'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
8
)
if
(
tdSql
.
getData
(
0
,
1
)
is
not
None
):
tdLog
.
exit
(
"data is not null"
)
tdLog
.
info
(
"=============== step9"
)
cmd
=
"insert into tb values (now+9m, 'null')"
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
9
)
if
(
tdSql
.
getData
(
0
,
1
)
is
not
None
):
tdLog
.
exit
(
"data is not null"
)
tdLog
.
info
(
"=============== step10"
)
cmd
=
'insert into tb values (now+10m, -123)'
tdLog
.
info
(
cmd
)
tdSql
.
execute
(
cmd
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdSql
.
checkRows
(
10
)
if
(
tdSql
.
getData
(
0
,
1
)
!=
-
123
):
tdLog
.
exit
(
"data is not -123"
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/test.py
浏览文件 @
c4eed9ec
...
...
@@ -105,10 +105,7 @@ if __name__ == "__main__":
if
fileName
==
"all"
:
tdCases
.
runAllLinux
(
conn
)
else
:
try
:
tdCases
.
runOneLinux
(
conn
,
fileName
)
except
Exception
as
e
:
tdLog
.
exit
(
"failed: %s"
%
fileName
)
conn
.
close
()
else
:
tdLog
.
notice
(
"Procedures for tdengine deployed in %s"
%
(
masterIp
))
...
...
tests/pytest/util/cases.py
浏览文件 @
c4eed9ec
...
...
@@ -71,7 +71,7 @@ class TDCases:
case
.
run
()
except
Exception
as
e
:
tdLog
.
notice
(
repr
(
e
))
tdLog
.
exit
(
"failed: %s"
%
fileName
)
tdLog
.
notice
(
"%s failed: %s"
%
(
__file__
,
fileName
)
)
case
.
stop
()
runNum
+=
1
continue
...
...
tests/test-all.sh
浏览文件 @
c4eed9ec
...
...
@@ -25,15 +25,17 @@ if [ "$totalFailed" -ne "0" ]; then
fi
cd
../pytest
./simpletest.sh 2>&1 |
grep
'successfully executed\|failed'
|
tee
pytest-out.txt
./simpletest.sh 2>&1 |
tee
pytest-out.txt
totalPySuccess
=
`
grep
'successfully executed'
pytest-out.txt |
wc
-l
`
if
[
"
$totalPySuccess
"
-gt
"0"
]
;
then
grep
'successfully executed'
pytest-out.txt
echo
-e
"
${
GREEN
}
### Total
$totalPySuccess
python case(s) succeed! ###
${
NC
}
"
fi
totalPyFailed
=
`
grep
'failed'
pytest-out.txt |
wc
-l
`
totalPyFailed
=
`
grep
'failed
\|fault
'
pytest-out.txt |
wc
-l
`
if
[
"
$totalPyFailed
"
-ne
"0"
]
;
then
cat
pytest-out.txt
echo
-e
"
${
RED
}
### Total
$totalPyFailed
python case(s) failed! ###
${
NC
}
"
exit
$totalPyFailed
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录