Merge pull request #1712 from taosdata/add-insert-testcase-to-2.0
Add insert int and float testcase to 2.0
This commit is contained in:
commit
f4538acffe
|
@ -64,7 +64,7 @@ matrix:
|
||||||
memError=`grep -m 1 'ERROR SUMMARY' mem-error-out.txt | awk '{print $4}'`
|
memError=`grep -m 1 'ERROR SUMMARY' mem-error-out.txt | awk '{print $4}'`
|
||||||
|
|
||||||
if [ -n "$memError" ]; then
|
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.\
|
echo -e "${RED} ## Memory errors number valgrind reports is $memError.\
|
||||||
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
|
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
|
||||||
travis_terminate $memError
|
travis_terminate $memError
|
||||||
|
|
|
@ -0,0 +1,147 @@
|
||||||
|
###################################################################
|
||||||
|
# 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())
|
|
@ -0,0 +1,184 @@
|
||||||
|
###################################################################
|
||||||
|
# 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())
|
|
@ -1,3 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
python3 ./test.py -f insert/basic.py $1
|
python3 ./test.py -f insert/basic.py $1
|
||||||
python3 ./test.py -s $1
|
python3 ./test.py -s $1
|
||||||
|
sleep 1
|
||||||
|
python3 ./test.py -f insert/int.py $1
|
||||||
|
python3 ./test.py -s $1
|
||||||
|
sleep 1
|
||||||
|
python3 ./test.py -f insert/float.py $1
|
||||||
|
python3 ./test.py -s $1
|
||||||
|
|
|
@ -100,7 +100,7 @@ if __name__ == "__main__":
|
||||||
tdDnodes.deploy(1)
|
tdDnodes.deploy(1)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
conn = taos.connect(
|
conn = taos.connect(
|
||||||
host='192.168.0.1',
|
host='127.0.0.1',
|
||||||
config=tdDnodes.getSimCfgPath())
|
config=tdDnodes.getSimCfgPath())
|
||||||
if fileName == "all":
|
if fileName == "all":
|
||||||
tdCases.runAllLinux(conn)
|
tdCases.runAllLinux(conn)
|
||||||
|
|
|
@ -67,12 +67,16 @@ class TDCases:
|
||||||
if tmp.name.find(fileName) != -1:
|
if tmp.name.find(fileName) != -1:
|
||||||
case = testModule.TDTestCase()
|
case = testModule.TDTestCase()
|
||||||
case.init(conn)
|
case.init(conn)
|
||||||
case.run()
|
try:
|
||||||
|
case.run()
|
||||||
|
except Exception as e:
|
||||||
|
tdLog.notice(repr(e))
|
||||||
|
tdLog.notice("%s failed: %s" % (__file__, fileName))
|
||||||
case.stop()
|
case.stop()
|
||||||
runNum += 1
|
runNum += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
tdLog.notice("total %d Linux test case(s) executed" % (runNum))
|
tdLog.success("total %d Linux test case(s) executed" % (runNum))
|
||||||
|
|
||||||
def runAllWindows(self, conn):
|
def runAllWindows(self, conn):
|
||||||
# TODO: load all Windows cases here
|
# TODO: load all Windows cases here
|
||||||
|
|
|
@ -19,12 +19,19 @@ from util.log import *
|
||||||
|
|
||||||
|
|
||||||
class TDSimClient:
|
class TDSimClient:
|
||||||
|
def __init__(self):
|
||||||
|
self.testCluster = False
|
||||||
|
|
||||||
def init(self, path):
|
def init(self, path):
|
||||||
|
self.__init__()
|
||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
def getCfgDir(self):
|
def getCfgDir(self):
|
||||||
return self.cfgDir
|
return self.cfgDir
|
||||||
|
|
||||||
|
def setTestCluster(self, value):
|
||||||
|
self.testCluster = value
|
||||||
|
|
||||||
def cfg(self, option, value):
|
def cfg(self, option, value):
|
||||||
cmd = "echo '%s %s' >> %s" % (option, value, self.cfgPath)
|
cmd = "echo '%s %s' >> %s" % (option, value, self.cfgPath)
|
||||||
if os.system(cmd) != 0:
|
if os.system(cmd) != 0:
|
||||||
|
@ -55,8 +62,9 @@ class TDSimClient:
|
||||||
if os.system(cmd) != 0:
|
if os.system(cmd) != 0:
|
||||||
tdLog.exit(cmd)
|
tdLog.exit(cmd)
|
||||||
|
|
||||||
self.cfg("masterIp", "192.168.0.1")
|
if self.testCluster:
|
||||||
self.cfg("secondIp", "192.168.0.2")
|
self.cfg("masterIp", "192.168.0.1")
|
||||||
|
self.cfg("secondIp", "192.168.0.2")
|
||||||
self.cfg("logDir", self.logDir)
|
self.cfg("logDir", self.logDir)
|
||||||
self.cfg("numOfLogLines", "100000000")
|
self.cfg("numOfLogLines", "100000000")
|
||||||
self.cfg("numOfThreadsPerCore", "2.0")
|
self.cfg("numOfThreadsPerCore", "2.0")
|
||||||
|
@ -128,11 +136,12 @@ class TDDnode:
|
||||||
if self.testCluster:
|
if self.testCluster:
|
||||||
self.startIP()
|
self.startIP()
|
||||||
|
|
||||||
self.cfg("masterIp", "192.168.0.1")
|
if self.testCluster:
|
||||||
self.cfg("secondIp", "192.168.0.2")
|
self.cfg("masterIp", "192.168.0.1")
|
||||||
self.cfg("publicIp", "192.168.0.%d" % (self.index))
|
self.cfg("secondIp", "192.168.0.2")
|
||||||
self.cfg("internalIp", "192.168.0.%d" % (self.index))
|
self.cfg("publicIp", "192.168.0.%d" % (self.index))
|
||||||
self.cfg("privateIp", "192.168.0.%d" % (self.index))
|
self.cfg("internalIp", "192.168.0.%d" % (self.index))
|
||||||
|
self.cfg("privateIp", "192.168.0.%d" % (self.index))
|
||||||
self.cfg("dataDir", self.dataDir)
|
self.cfg("dataDir", self.dataDir)
|
||||||
self.cfg("logDir", self.logDir)
|
self.cfg("logDir", self.logDir)
|
||||||
self.cfg("numOfLogLines", "100000000")
|
self.cfg("numOfLogLines", "100000000")
|
||||||
|
@ -291,10 +300,6 @@ class TDDnodes:
|
||||||
for i in range(len(self.dnodes)):
|
for i in range(len(self.dnodes)):
|
||||||
self.dnodes[i].init(self.path)
|
self.dnodes[i].init(self.path)
|
||||||
|
|
||||||
self.sim = TDSimClient()
|
|
||||||
self.sim.init(self.path)
|
|
||||||
self.sim.deploy()
|
|
||||||
|
|
||||||
def setTestCluster(self, value):
|
def setTestCluster(self, value):
|
||||||
self.testCluster = value
|
self.testCluster = value
|
||||||
|
|
||||||
|
@ -302,6 +307,11 @@ class TDDnodes:
|
||||||
self.valgrind = value
|
self.valgrind = value
|
||||||
|
|
||||||
def deploy(self, index):
|
def deploy(self, index):
|
||||||
|
self.sim = TDSimClient()
|
||||||
|
self.sim.init(self.path)
|
||||||
|
self.sim.setTestCluster(self.testCluster)
|
||||||
|
self.sim.deploy()
|
||||||
|
|
||||||
self.check(index)
|
self.check(index)
|
||||||
self.dnodes[index - 1].setTestCluster(self.testCluster)
|
self.dnodes[index - 1].setTestCluster(self.testCluster)
|
||||||
self.dnodes[index - 1].setValgrind(self.valgrind)
|
self.dnodes[index - 1].setValgrind(self.valgrind)
|
||||||
|
|
|
@ -63,7 +63,7 @@ class TDSql:
|
||||||
def checkRows(self, expectRows):
|
def checkRows(self, expectRows):
|
||||||
if self.queryRows != expectRows:
|
if self.queryRows != expectRows:
|
||||||
tdLog.exit(
|
tdLog.exit(
|
||||||
"sql:%.40s, queryRows:%d != expect:%d" %
|
"failed: sql:%.40s, queryRows:%d != expect:%d" %
|
||||||
(self.sql, self.queryRows, expectRows))
|
(self.sql, self.queryRows, expectRows))
|
||||||
tdLog.info("sql:%.40s, queryRows:%d == expect:%d" %
|
tdLog.info("sql:%.40s, queryRows:%d == expect:%d" %
|
||||||
(self.sql, self.queryRows, expectRows))
|
(self.sql, self.queryRows, expectRows))
|
||||||
|
|
|
@ -25,15 +25,17 @@ if [ "$totalFailed" -ne "0" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ../pytest
|
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`
|
totalPySuccess=`grep 'successfully executed' pytest-out.txt | wc -l`
|
||||||
|
|
||||||
if [ "$totalPySuccess" -gt "0" ]; then
|
if [ "$totalPySuccess" -gt "0" ]; then
|
||||||
|
grep 'successfully executed' pytest-out.txt
|
||||||
echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}"
|
echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
totalPyFailed=`grep 'failed' pytest-out.txt | wc -l`
|
totalPyFailed=`grep 'failed\|fault' pytest-out.txt | wc -l`
|
||||||
if [ "$totalPyFailed" -ne "0" ]; then
|
if [ "$totalPyFailed" -ne "0" ]; then
|
||||||
|
cat pytest-out.txt
|
||||||
echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}"
|
echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}"
|
||||||
exit $totalPyFailed
|
exit $totalPyFailed
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue