未验证 提交 47c0cbc8 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

fix: taosbenchmark schemaless refine 2.6 (#19715)

* fix: taos-tools 143b9e4 for taosbenchmark schemaless refine for 2.6

* fix: update taos-tools 723f696 for 2.6

* test: fix outdated sml json test cases

* fix: update taos-tools 181bcac for 2.6
上级 acc00d6d
Subproject commit 0cd564ab5b00bd2e6127c61bc79e89703eac7040
Subproject commit 181bcac3f3646ea2f55d108d2e52d3530042c6bc
......@@ -19,10 +19,9 @@ from util.dnodes import *
class TDTestCase:
def caseDescription(self):
'''
"""
[TD-11510] taosBenchmark test cases
'''
return
"""
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
......@@ -31,19 +30,26 @@ class TDTestCase:
def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
projPath = selfPath[:selfPath.find("community")]
if "community" in selfPath:
projPath = selfPath[: selfPath.find("community")]
elif "src" in selfPath:
projPath = selfPath[: selfPath.find("src")]
elif "/tools/" in selfPath:
projPath = selfPath[: selfPath.find("/tools/")]
elif "/tests/" in selfPath:
projPath = selfPath[: selfPath.find("/tests/")]
else:
projPath = selfPath[:selfPath.find("tests")]
tdLog.info("cannot found %s in path: %s, use system's" % (tool, selfPath))
projPath = "/usr/local/taos/bin/"
paths = []
for root, dirs, files in os.walk(projPath):
if ((tool) in files):
for root, dummy, files in os.walk(projPath):
if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root))
if ("packaging" not in rootRealPath):
if "packaging" not in rootRealPath:
paths.append(os.path.join(root, tool))
break
if (len(paths) == 0):
if len(paths) == 0:
tdLog.exit("taosBenchmark not found!")
return
else:
......@@ -51,31 +57,45 @@ class TDTestCase:
return paths[0]
def run(self):
tdSql.query("select client_version()")
client_ver = "".join(tdSql.queryResult[0])
major_ver = client_ver.split(".")[0]
binPath = self.getPath()
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" %binPath
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/sml_json_alltypes.json" % binPath
tdLog.info("%s" % cmd)
os.system("%s" % cmd)
tdSql.execute("reset query cache")
tdSql.query("describe db.stb1")
tdSql.checkData(1, 1, "BOOL")
tdSql.query("describe db.stb2")
tdSql.checkData(1, 1, "TINYINT")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb3")
tdSql.checkData(1, 1, "SMALLINT")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb4")
tdSql.checkData(1, 1, "INT")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb5")
tdSql.checkData(1, 1, "BIGINT")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb6")
tdSql.checkData(1, 1, "FLOAT")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb7")
tdSql.checkData(1, 1, "DOUBLE")
tdSql.query("describe db.stb8")
tdSql.checkData(1, 1, "BINARY")
tdSql.checkData(1, 2, 8)
if major_ver == "3":
tdSql.checkData(1, 1, "VARCHAR")
tdSql.checkData(1, 2, 16)
else:
tdSql.checkData(1, 1, "NCHAR")
tdSql.checkData(1, 2, 8)
tdSql.query("describe db.stb9")
tdSql.checkData(1, 1, "NCHAR")
tdSql.checkData(1, 2, 8)
if major_ver == "3":
tdSql.checkData(1, 1, "VARCHAR")
tdSql.checkData(1, 2, 16)
else:
tdSql.checkData(1, 1, "NCHAR")
tdSql.checkData(1, 2, 8)
tdSql.query("select count(*) from db.stb1")
tdSql.checkData(0, 0, 160)
tdSql.query("select count(*) from db.stb2")
......@@ -101,4 +121,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
tdCases.addLinux(__file__, TDTestCase())
......@@ -91,7 +91,7 @@
"batch_create_tbl_num": 100,
"data_source": "rand",
"insert_mode": "sml",
"line_protocol": "json" ,
"line_protocol": "taosjson" ,
"insert_rows":50,
"childtable_limit": -1,
"childtable_offset":0,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册