提交 826cc194 编写于 作者: S shenglian zhou

mavg/csum/sample test case developer self test modification

上级 539ec4c9
......@@ -388,6 +388,16 @@ class TDTestCase:
self.checksample(**case25)
case26 = {"k": 1000}
self.checksample(**case26)
case27 = {
"table_expr": "stb1",
"condition": "group by tbname slimit 1 "
}
self.checksample(**case27) # with slimit
case28 = {
"table_expr": "stb1",
"condition": "group by tbname slimit 1 soffset 1"
}
self.checksample(**case28) # with soffset
pass
......@@ -497,16 +507,7 @@ class TDTestCase:
"condition": "group by c6"
}
# self.checksample(**err46) # group by normal col
err47 = {
"table_expr": "stb1",
"condition": "group by tbname slimit 1 "
}
self.checksample(**err47) # with slimit
err48 = {
"table_expr": "stb1",
"condition": "group by tbname slimit 1 soffset 1"
}
self.checksample(**err48) # with soffset
err49 = {"k": "2021-01-01 00:00:00.000"}
self.checksample(**err49) # k: timestamp
err50 = {"k": False}
......@@ -653,10 +654,14 @@ class TDTestCase:
self.sample_error_query()
def run(self):
import traceback
try:
# run in develop branch
self.sample_test_run()
pass
except Exception as e:
traceback.print_exc()
raise e
def stop(self):
tdSql.close()
......
......@@ -59,6 +59,12 @@ class TDTestCase:
tdSql.checkRows(0)
return
if "order by tbname" in condition:
tdSql.error(self.csum_query_form(
col=col, alias=alias, table_expr=table_expr, condition=condition
))
return
if "group" in condition:
tb_condition = condition.split("group by")[1].split(" ")[1]
......@@ -195,11 +201,6 @@ class TDTestCase:
# case20~21: with order by
case20 = {"condition": "order by ts"}
self.checkcsum(**case20)
case21 = {
"table_expr": "stb1",
"condition": "group by tbname order by tbname"
}
self.checkcsum(**case21)
# case22: with union
case22 = {
......@@ -290,6 +291,11 @@ class TDTestCase:
"condition": "group by tbname slimit 1 soffset 1"
}
tdSql.error(self.csum_query_form(**slimit_soffset_sql))
order_by_tbname_sql = {
"table_expr": "stb1",
"condition": "group by tbname order by tbname"
}
tdSql.error(self.csum_query_form(**order_by_tbname_sql))
pass
......@@ -398,9 +404,15 @@ class TDTestCase:
self.csum_error_query()
def run(self):
import traceback
try:
# run in develop branch
self.csum_test_run()
pass
except Exception as e:
traceback.print_exc()
raise e
def stop(self):
......
......@@ -154,6 +154,13 @@ class TDTestCase:
table_expr=table_expr, condition=condition
))
if "order by tbname" in condition.lower():
print(f"case in {line}: ", end='')
return tdSql.error(self.mavg_query_form(
sel=sel, func=func, col=col, m_comm=m_comm, k=k, r_comm=r_comm, alias=alias, fr=fr,
table_expr=table_expr, condition=condition
))
if all(["group" in condition.lower(), "tbname" not in condition.lower()]):
print(f"case in {line}: ", end='')
return tdSql.error(self.mavg_query_form(
......@@ -356,11 +363,11 @@ class TDTestCase:
# case20~21: with order by
case20 = {"condition": "order by ts"}
self.checkmavg(**case20)
case21 = {
"table_expr": "stb1",
"condition": "group by tbname order by tbname"
}
self.checkmavg(**case21)
#case21 = {
# "table_expr": "stb1",
# "condition": "group by tbname order by tbname"
#}
#self.checkmavg(**case21)
# case22: with union
case22 = {
......@@ -538,6 +545,11 @@ class TDTestCase:
self.checkmavg(**err66) # k: NULL
err67 = {"k": 0.999999}
self.checkmavg(**err67) # k: left out of [1, 1000]
err68 = {
"table_expr": "stb1",
"condition": "group by tbname order by tbname" # order by tbname not supported
}
self.checkmavg(**err68)
pass
......@@ -646,9 +658,14 @@ class TDTestCase:
self.mavg_error_query()
def run(self):
import traceback
try:
# run in develop branch
self.mavg_test_run()
pass
except Exception as e:
traceback.print_exc()
raise e
def stop(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册