From a860793c99820fc5ab3fdaba3916b45f907498e9 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 24 Dec 2024 19:42:13 +0800 Subject: [PATCH] fix: init migrate to run init --- tests/army/frame/caseBase.py | 1 + tests/army/tools/runcase.sh | 11 ++++++++++- tests/army/tools/taosdump/native/taosdumpTest.py | 12 ++++-------- tests/army/tools/taosdump/native/taosdumpTest2.py | 13 ++++--------- .../taosdump/native/taosdumpTestNanoSupport.py | 11 +++-------- .../native/taosdumpTestTypeUnsignedBigInt.py | 2 +- .../native/taosdumpTestTypeUnsignedSmallInt.py | 2 +- .../ws3/taosdumpTestTypeUnsignedSmallInt.py | 2 +- 8 files changed, 25 insertions(+), 29 deletions(-) diff --git a/tests/army/frame/caseBase.py b/tests/army/frame/caseBase.py index 3cb33e8fbc..d8dcb29e44 100644 --- a/tests/army/frame/caseBase.py +++ b/tests/army/frame/caseBase.py @@ -37,6 +37,7 @@ class TBase: # save param self.replicaVar = int(replicaVar) tdSql.init(conn.cursor(), True) + self.tmpdir = "tmp" # record server information self.dnodeNum = 0 diff --git a/tests/army/tools/runcase.sh b/tests/army/tools/runcase.sh index 5683485bca..df5723e947 100644 --- a/tests/army/tools/runcase.sh +++ b/tests/army/tools/runcase.sh @@ -6,4 +6,13 @@ for i in `find tools/benchmark/basic/ -name "*.py"` ((count=count+1)) done -echo "benchmark/basic count=$count \n" \ No newline at end of file +echo "benchmark/basic count=$count \n" + + +for i in `find tools/taosdump/native/ -name "*.py"` + do printf "\n\n ***** cnt=$count python3 test.py -f $i *****\n\n" + python3 test.py -f $i + ((count=count+1)) +done + +echo "taosdump/native count=$count \n" \ No newline at end of file diff --git a/tests/army/tools/taosdump/native/taosdumpTest.py b/tests/army/tools/taosdump/native/taosdumpTest.py index 016f4215f8..74c9451100 100644 --- a/tests/army/tools/taosdump/native/taosdumpTest.py +++ b/tests/army/tools/taosdump/native/taosdumpTest.py @@ -22,14 +22,6 @@ from frame import * class TDTestCase(TBase): - def init(self, conn, logSql): - tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), logSql) - - self.ts = 1538548685000 - self.numberOfTables = 10000 - self.numberOfRecords = 100 - def checkCommunity(self): selfPath = os.path.dirname(os.path.realpath(__file__)) if "community" in selfPath: @@ -39,6 +31,10 @@ class TDTestCase(TBase): def run(self): + self.ts = 1538548685000 + self.numberOfTables = 10000 + self.numberOfRecords = 100 + if not os.path.exists("./taosdumptest/tmp1"): os.makedirs("./taosdumptest/tmp1") else: diff --git a/tests/army/tools/taosdump/native/taosdumpTest2.py b/tests/army/tools/taosdump/native/taosdumpTest2.py index 3b30e664ba..a119d4bb5e 100644 --- a/tests/army/tools/taosdump/native/taosdumpTest2.py +++ b/tests/army/tools/taosdump/native/taosdumpTest2.py @@ -25,15 +25,6 @@ import random class TDTestCase(TBase): - def init(self, conn, logSql): - tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), logSql) - - self.ts = 1601481600000 - self.numberOfTables = 1 - self.numberOfRecords = 150 - - def generateString(self, length): chars = string.ascii_uppercase + string.ascii_lowercase v = "" @@ -42,6 +33,10 @@ class TDTestCase(TBase): return v def run(self): + self.ts = 1601481600000 + self.numberOfTables = 1 + self.numberOfRecords = 150 + if not os.path.exists("./taosdumptest/tmp"): os.makedirs("./taosdumptest/tmp") else: diff --git a/tests/army/tools/taosdump/native/taosdumpTestNanoSupport.py b/tests/army/tools/taosdump/native/taosdumpTestNanoSupport.py index 2fc6cc94c6..0b5a3a7690 100644 --- a/tests/army/tools/taosdump/native/taosdumpTestNanoSupport.py +++ b/tests/army/tools/taosdump/native/taosdumpTestNanoSupport.py @@ -22,14 +22,6 @@ from frame import * class TDTestCase(TBase): - def init(self, conn, logSql): - tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), logSql) - - self.ts = 1625068800000000000 # this is timestamp "2021-07-01 00:00:00" - self.numberOfTables = 10 - self.numberOfRecords = 100 - def checkCommunity(self): selfPath = os.path.dirname(os.path.realpath(__file__)) if "community" in selfPath: @@ -92,6 +84,9 @@ class TDTestCase(TBase): print("other time precision not valid , please check! ") def run(self): + self.ts = 1625068800000000000 # this is timestamp "2021-07-01 00:00:00" + self.numberOfTables = 10 + self.numberOfRecords = 100 # clear envs os.system("rm -rf ./taosdumptest/") diff --git a/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedBigInt.py b/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedBigInt.py index 95700e149a..5805114fc5 100644 --- a/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedBigInt.py +++ b/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedBigInt.py @@ -100,7 +100,7 @@ class TDTestCase(TBase): tdSql.query("select * from st where ubntag is null") tdSql.checkRows(1) - tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 0, 1640000000000) tdSql.checkData(0, 1, None) tdSql.checkData(0, 2, None) diff --git a/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedSmallInt.py b/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedSmallInt.py index c6de008530..578916b282 100644 --- a/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedSmallInt.py +++ b/tests/army/tools/taosdump/native/taosdumpTestTypeUnsignedSmallInt.py @@ -103,7 +103,7 @@ class TDTestCase(TBase): tdSql.query("select * from st where usntag is null") tdSql.checkRows(1) - tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 0, 1640000000000) tdSql.checkData(0, 1, None) tdSql.checkData(0, 2, None) diff --git a/tests/army/tools/taosdump/ws3/taosdumpTestTypeUnsignedSmallInt.py b/tests/army/tools/taosdump/ws3/taosdumpTestTypeUnsignedSmallInt.py index 5ff932e580..ae5a27dc56 100644 --- a/tests/army/tools/taosdump/ws3/taosdumpTestTypeUnsignedSmallInt.py +++ b/tests/army/tools/taosdump/ws3/taosdumpTestTypeUnsignedSmallInt.py @@ -105,7 +105,7 @@ class TDTestCase(TBase): tdSql.query("select * from st where usntag is null") tdSql.checkRows(1) - tdSql.checkData(0, 0, 0) + tdSql.checkData(0, 0, 1640000000000) tdSql.checkData(0, 1, None) tdSql.checkData(0, 2, None)