From 019ae02ba07dcb0ef0c3f55c6a1895d756fe6f97 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 7 Oct 2022 01:12:21 +0800 Subject: [PATCH] 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 --- src/kit/taos-tools | 2 +- .../taosbenchmark/default_json.py | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/kit/taos-tools b/src/kit/taos-tools index f03c09a9f0..85179e9978 160000 --- a/src/kit/taos-tools +++ b/src/kit/taos-tools @@ -1 +1 @@ -Subproject commit f03c09a9f0882949b52f34f11607808ee17bfbc5 +Subproject commit 85179e99785182bb630832216f887ef84ca23474 diff --git a/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py index a84fe06274..91c56c6a60 100644 --- a/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py +++ b/tests/develop-test/5-taos-tools/taosbenchmark/default_json.py @@ -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,19 @@ 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")] else: - projPath = selfPath[:selfPath.find("tests")] + projPath = selfPath[: selfPath.find("tests")] paths = [] for root, dirs, files in os.walk(projPath): - if ((tool) in files): + 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: @@ -52,14 +51,15 @@ class TDTestCase: def run(self): 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) os.system("%s" % cmd) tdSql.execute("reset query cache") tdSql.query("select count(tbname) from db.stb") tdSql.checkData(0, 0, 10) 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): tdSql.close() @@ -67,4 +67,4 @@ class TDTestCase: tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file +tdCases.addLinux(__file__, TDTestCase()) -- GitLab