提交 f637ac29 编写于 作者: haoranc's avatar haoranc

teat: supplement muti-branch for testcase elapsed.py

上级 c5d95abb
...@@ -86,13 +86,20 @@ class TDTestCase: ...@@ -86,13 +86,20 @@ class TDTestCase:
''' '''
return return
def prepare_data(self): def prepare_db(self,dbname,vgroupVar):
tdLog.info (" ====================================== prepare db ==================================================")
tdSql.execute('drop database if exists testdb ;')
tdSql.execute('create database %s keep 36500 vgroups %d ;'%(dbname,vgroupVar))
def prepare_data(self,dbname):
tdLog.info (" ====================================== prepare data ==================================================") tdLog.info (" ====================================== prepare data ==================================================")
tdSql.execute('drop database if exists testdb ;') # tdSql.execute('drop database if exists testdb ;')
tdSql.execute('create database testdb keep 36500;') # tdSql.execute('create database testdb keep 36500;')
tdSql.execute('use testdb;') tdSql.execute('use %s;'%dbname)
tdSql.execute('create stable stable_1(ts timestamp ,tscol timestamp, q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint, q_float float ,\ tdSql.execute('create stable stable_1(ts timestamp ,tscol timestamp, q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint, q_float float ,\
q_double double , bin_chars binary(20)) tags(loc nchar(20) ,ind int,tstag timestamp);') q_double double , bin_chars binary(20)) tags(loc nchar(20) ,ind int,tstag timestamp);')
...@@ -1317,6 +1324,13 @@ class TDTestCase: ...@@ -1317,6 +1324,13 @@ class TDTestCase:
# # bug fix # # bug fix
tdSql.error("select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;") tdSql.error("select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;")
#TD-19911
tdSql.error("select elapsed(ts,1s,123) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed() from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(tscol,1s) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(ts,1n) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.error("select elapsed(ts,1y) from (select ts,tbname from regular_table_1 order by ts asc );")
# case TD-12276 # case TD-12276
tdSql.query("select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );") tdSql.query("select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );")
tdSql.checkData(0,0,90.000000000) tdSql.checkData(0,0,90.000000000)
...@@ -1525,7 +1539,6 @@ class TDTestCase: ...@@ -1525,7 +1539,6 @@ class TDTestCase:
def query_precision(self): def query_precision(self):
def generate_data(precision="ms"): def generate_data(precision="ms"):
tdSql.execute("create database if not exists db_%s precision '%s';" %(precision, precision)) tdSql.execute("create database if not exists db_%s precision '%s';" %(precision, precision))
tdSql.execute("use db_%s;" %precision) tdSql.execute("use db_%s;" %precision)
tdSql.execute("create stable db_%s.st (ts timestamp , id int) tags(ind int);"%precision) tdSql.execute("create stable db_%s.st (ts timestamp , id int) tags(ind int);"%precision)
...@@ -1579,7 +1592,9 @@ class TDTestCase: ...@@ -1579,7 +1592,9 @@ class TDTestCase:
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
self.prepare_data() dbNameTest="testdbV1"
self.prepare_db(dbNameTest,1)
self.prepare_data(dbNameTest)
self.abnormal_common_test() self.abnormal_common_test()
self.abnormal_use_test() self.abnormal_use_test()
self.query_filter() self.query_filter()
...@@ -1596,6 +1611,25 @@ class TDTestCase: ...@@ -1596,6 +1611,25 @@ class TDTestCase:
self.continuous_query() self.continuous_query()
self.query_precision() self.query_precision()
dbNameTest="testdbV2"
self.prepare_db(dbNameTest,2)
self.prepare_data(dbNameTest)
self.abnormal_common_test()
self.abnormal_use_test()
self.query_filter()
# self.query_interval()
self.query_mix_common()
self.query_mix_Aggregate()
self.query_mix_select()
self.query_mix_compute()
self.query_mix_arithmetic()
# self.query_with_join()
# self.query_with_union()
self.query_nest()
self.query_session_windows()
self.continuous_query()
# self.query_precision()
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册