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

fix: taosbenchmark stmt + csv rework for 2.6 (#17195)

* fix: taosbenchmark stmt + csv rework for 2.6

* test: taosbenchmark default_json align with doc

* fix: taosbenchmark sample csv insert rows

* test: fix default_json.py to align with doc
上级 21514b0d
Subproject commit f03c09a9f0882949b52f34f11607808ee17bfbc5 Subproject commit 85179e99785182bb630832216f887ef84ca23474
...@@ -19,10 +19,9 @@ from util.dnodes import * ...@@ -19,10 +19,9 @@ from util.dnodes import *
class TDTestCase: class TDTestCase:
def caseDescription(self): def caseDescription(self):
''' """
[TD-11510] taosBenchmark test cases [TD-11510] taosBenchmark test cases
''' """
return
def init(self, conn, logSql): def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
...@@ -31,19 +30,19 @@ class TDTestCase: ...@@ -31,19 +30,19 @@ class TDTestCase:
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath): if "community" in selfPath:
projPath = selfPath[:selfPath.find("community")] projPath = selfPath[: selfPath.find("community")]
else: else:
projPath = selfPath[:selfPath.find("tests")] projPath = selfPath[: selfPath.find("tests")]
paths = [] paths = []
for root, dirs, files in os.walk(projPath): for root, dirs, files in os.walk(projPath):
if ((tool) in files): if (tool) in files:
rootRealPath = os.path.dirname(os.path.realpath(root)) 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)) paths.append(os.path.join(root, tool))
break break
if (len(paths) == 0): if len(paths) == 0:
tdLog.exit("taosBenchmark not found!") tdLog.exit("taosBenchmark not found!")
return return
else: else:
...@@ -52,14 +51,15 @@ class TDTestCase: ...@@ -52,14 +51,15 @@ class TDTestCase:
def run(self): def run(self):
binPath = self.getPath() binPath = self.getPath()
cmd = "%s -f ./5-taos-tools/taosbenchmark/json/default.json" %binPath cmd = "%s -f ./5-taos-tools/taosbenchmark/json/default.json" % binPath
tdLog.info("%s" % cmd) tdLog.info("%s" % cmd)
os.system("%s" % cmd) os.system("%s" % cmd)
tdSql.execute("reset query cache") tdSql.execute("reset query cache")
tdSql.query("select count(tbname) from db.stb") tdSql.query("select count(tbname) from db.stb")
tdSql.checkData(0, 0, 10) tdSql.checkData(0, 0, 10)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")
tdSql.checkData(0, 0, 100) if len(tdSql.queryResult):
tdLog.exit("query result is %d" % len(tdSql.queryResult))
def stop(self): def stop(self):
tdSql.close() tdSql.close()
...@@ -67,4 +67,4 @@ class TDTestCase: ...@@ -67,4 +67,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase()) tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase()) tdCases.addLinux(__file__, TDTestCase())
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册