test : test case execute
This commit is contained in:
parent
b423314be1
commit
f103fec944
|
@ -112,11 +112,6 @@ class AutoGen:
|
||||||
sql = f"create table {stbname} (ts timestamp, {cols}) tags({tags})"
|
sql = f"create table {stbname} (ts timestamp, {cols}) tags({tags})"
|
||||||
tdSql.execute(sql)
|
tdSql.execute(sql)
|
||||||
|
|
||||||
# create stream
|
|
||||||
sql = f"create stream m_{stbname} fill_history 1 into st_{stbname} as select count(*) from {stbname} interval(100a);"
|
|
||||||
tdLog.info(f" create stable {stbname} ok. column={column_cnt} tag={tag_cnt} ")
|
|
||||||
|
|
||||||
|
|
||||||
# create child table
|
# create child table
|
||||||
def create_child(self, stbname, prename, cnt):
|
def create_child(self, stbname, prename, cnt):
|
||||||
self.child_cnt = cnt
|
self.child_cnt = cnt
|
||||||
|
|
|
@ -11,9 +11,23 @@ import string
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
tdSql.init(conn.cursor(), logSql)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
tdLog.info("hello world.")
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test Main class
|
# Test Main class
|
||||||
#
|
#
|
||||||
|
|
||||||
|
'''
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
def init(self, conn, logSql, replicaVar=1):
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
self.replicaVar = int(replicaVar)
|
self.replicaVar = int(replicaVar)
|
||||||
|
@ -44,13 +58,13 @@ class TDTestCase:
|
||||||
dbname = "test"
|
dbname = "test"
|
||||||
stbname = "st"
|
stbname = "st"
|
||||||
childname = "d"
|
childname = "d"
|
||||||
child_cnt = 20
|
child_cnt = 2
|
||||||
insert_rows = 1000
|
insert_rows = 10
|
||||||
tag_cnt = 15
|
tag_cnt = 15
|
||||||
column_cnt = 25
|
column_cnt = 20
|
||||||
binary_len = 30
|
binary_len = 10240
|
||||||
nchar_len = 45
|
nchar_len = 1025
|
||||||
self.autoGen.set_batch_size(500)
|
self.autoGen.set_batch_size(1)
|
||||||
|
|
||||||
# normal
|
# normal
|
||||||
self.test_db(dbname, stbname, childname, tag_cnt, column_cnt, child_cnt, insert_rows, binary_len, nchar_len)
|
self.test_db(dbname, stbname, childname, tag_cnt, column_cnt, child_cnt, insert_rows, binary_len, nchar_len)
|
||||||
|
@ -58,7 +72,7 @@ class TDTestCase:
|
||||||
# max
|
# max
|
||||||
dbname = "test_max_col"
|
dbname = "test_max_col"
|
||||||
child_cnt = 3
|
child_cnt = 3
|
||||||
insert_rows = 100
|
insert_rows = 50
|
||||||
tag_cnt = 128
|
tag_cnt = 128
|
||||||
binary_len = 3
|
binary_len = 3
|
||||||
nchar_len = 4
|
nchar_len = 4
|
||||||
|
@ -70,7 +84,7 @@ class TDTestCase:
|
||||||
def stop(self):
|
def stop(self):
|
||||||
tdSql.close()
|
tdSql.close()
|
||||||
tdLog.success("%s successfully executed" % __file__)
|
tdLog.success("%s successfully executed" % __file__)
|
||||||
|
'''
|
||||||
|
|
||||||
tdCases.addWindows(__file__, TDTestCase())
|
tdCases.addWindows(__file__, TDTestCase())
|
||||||
tdCases.addLinux(__file__, TDTestCase())
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
|
Loading…
Reference in New Issue