fix: add test case
This commit is contained in:
parent
c3c8d7b07d
commit
0e525a8e22
|
@ -43,6 +43,7 @@ fi
|
||||||
#,,n,system-test,python3 ./test.py -f 8-stream/snode_restart.py -N 4
|
#,,n,system-test,python3 ./test.py -f 8-stream/snode_restart.py -N 4
|
||||||
,,n,system-test,python3 ./test.py -f 8-stream/snode_restart_with_checkpoint.py -N 4
|
,,n,system-test,python3 ./test.py -f 8-stream/snode_restart_with_checkpoint.py -N 4
|
||||||
|
|
||||||
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/partition_expr.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/project_group.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/project_group.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tbname_vgroup.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tbname_vgroup.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_interval.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/count_interval.py
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
from wsgiref.headers import tspecials
|
||||||
|
from util.log import *
|
||||||
|
from util.cases import *
|
||||||
|
from util.sql import *
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
self.replicaVar = int(replicaVar)
|
||||||
|
tdLog.debug("start to execute %s" % __file__)
|
||||||
|
tdSql.init(conn.cursor())
|
||||||
|
|
||||||
|
self.rowNum = 10
|
||||||
|
self.batchNum = 5
|
||||||
|
self.ts = 1537146000000
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
dbname = "db"
|
||||||
|
tdSql.prepare()
|
||||||
|
|
||||||
|
tdSql.execute(f'''create table sta(ts timestamp, f int, col2 bigint) tags(tg1 int, tg2 binary(20))''')
|
||||||
|
tdSql.execute(f"create table sta1 using sta tags(1, 'a')")
|
||||||
|
tdSql.execute(f"insert into sta1 values(1537146000001, 11, 110)")
|
||||||
|
tdSql.execute(f"insert into sta1 values(1537146000002, 12, 120)")
|
||||||
|
tdSql.execute(f"insert into sta1 values(1537146000003, 13, 130)")
|
||||||
|
|
||||||
|
tdSql.query("select _wstart, f+100, count(*) from db.sta partition by f+100 session(ts, 1a) order by _wstart");
|
||||||
|
tdSql.checkData(0, 1, 111.0)
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
Loading…
Reference in New Issue