From 20c2eb1d8492e9f50dc4b8655cc364b501a45ae5 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 7 Jun 2022 09:49:09 +0800 Subject: [PATCH 1/5] fix(os): add win32 query case --- tests/pytest/test.py | 2 +- tests/system-test/fulltest.bat | 10 +++++----- tests/system-test/test.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/pytest/test.py b/tests/pytest/test.py index 30ab6ae3cc..1b185ef189 100644 --- a/tests/pytest/test.py +++ b/tests/pytest/test.py @@ -131,7 +131,7 @@ if __name__ == "__main__": is_test_framework = 0 key_word = 'tdCases.addWindows' try: - if key_word in open(fileName).read(): + if key_word in open(fileName, encoding='UTF-8').read(): is_test_framework = 1 except: pass diff --git a/tests/system-test/fulltest.bat b/tests/system-test/fulltest.bat index 6ef66c58c2..1a7d35cd17 100644 --- a/tests/system-test/fulltest.bat +++ b/tests/system-test/fulltest.bat @@ -18,11 +18,11 @@ python3 .\test.py -f 0-others\udf_restart_taosd.py @REM #python3 .\test.py -f 1-insert\test_stmt_muti_insert_query.py @REM python3 .\test.py -f 1-insert\alter_stable.py @REM python3 .\test.py -f 1-insert\alter_table.py -@REM python3 .\test.py -f 2-query\between.py -@REM python3 .\test.py -f 2-query\distinct.py -@REM python3 .\test.py -f 2-query\varchar.py -@REM python3 .\test.py -f 2-query\ltrim.py -@REM python3 .\test.py -f 2-query\rtrim.py +python3 .\test.py -f 2-query\between.py +python3 .\test.py -f 2-query\distinct.py +python3 .\test.py -f 2-query\varchar.py +python3 .\test.py -f 2-query\ltrim.py +python3 .\test.py -f 2-query\rtrim.py @REM python3 .\test.py -f 2-query\length.py @REM python3 .\test.py -f 2-query\char_length.py @REM python3 .\test.py -f 2-query\upper.py diff --git a/tests/system-test/test.py b/tests/system-test/test.py index d9ae792901..8350f6752f 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -168,7 +168,7 @@ if __name__ == "__main__": key_word = 'tdCases.addWindows' is_test_framework = 0 try: - if key_word in open(fileName).read(): + if key_word in open(fileName, encoding='UTF-8').read(): is_test_framework = 1 except: pass From fc5455c8a0884978a5d06ea419d64f4df6c31635 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 7 Jun 2022 11:15:55 +0800 Subject: [PATCH 2/5] fix(os): add win32 query case --- tests/system-test/fulltest.bat | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/system-test/fulltest.bat b/tests/system-test/fulltest.bat index 1a7d35cd17..b94e849472 100644 --- a/tests/system-test/fulltest.bat +++ b/tests/system-test/fulltest.bat @@ -23,22 +23,22 @@ python3 .\test.py -f 2-query\distinct.py python3 .\test.py -f 2-query\varchar.py python3 .\test.py -f 2-query\ltrim.py python3 .\test.py -f 2-query\rtrim.py -@REM python3 .\test.py -f 2-query\length.py -@REM python3 .\test.py -f 2-query\char_length.py -@REM python3 .\test.py -f 2-query\upper.py -@REM python3 .\test.py -f 2-query\lower.py -@REM python3 .\test.py -f 2-query\join.py -@REM python3 .\test.py -f 2-query\join2.py +python3 .\test.py -f 2-query\length.py +python3 .\test.py -f 2-query\char_length.py +python3 .\test.py -f 2-query\upper.py +python3 .\test.py -f 2-query\lower.py +python3 .\test.py -f 2-query\join.py +python3 .\test.py -f 2-query\join2.py @REM python3 .\test.py -f 2-query\cast.py -@REM python3 .\test.py -f 2-query\union.py -@REM python3 .\test.py -f 2-query\union1.py -@REM python3 .\test.py -f 2-query\concat.py -@REM python3 .\test.py -f 2-query\concat2.py -@REM python3 .\test.py -f 2-query\concat_ws.py -@REM python3 .\test.py -f 2-query\concat_ws2.py -@REM python3 .\test.py -f 2-query\check_tsdb.py -@REM python3 .\test.py -f 2-query\spread.py -@REM python3 .\test.py -f 2-query\hyperloglog.py +python3 .\test.py -f 2-query\union.py +python3 .\test.py -f 2-query\union1.py +python3 .\test.py -f 2-query\concat.py +python3 .\test.py -f 2-query\concat2.py +python3 .\test.py -f 2-query\concat_ws.py +python3 .\test.py -f 2-query\concat_ws2.py +python3 .\test.py -f 2-query\check_tsdb.py +python3 .\test.py -f 2-query\spread.py +python3 .\test.py -f 2-query\hyperloglog.py @REM python3 .\test.py -f 2-query\timezone.py From a5dd5d64b66c379ae67e31c9b75b2df9fb2ee587 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 7 Jun 2022 11:18:58 +0800 Subject: [PATCH 3/5] fix(os): add win32 query case --- tests/system-test/2-query/between.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/2-query/between.py b/tests/system-test/2-query/between.py index 44750abd46..7e2ac1c8b9 100644 --- a/tests/system-test/2-query/between.py +++ b/tests/system-test/2-query/between.py @@ -143,7 +143,7 @@ class TDTestCase: tdSql.checkRows(9) tdSql.query("select * from t1 where c5 between 136 and 127") tdSql.checkRows(0) - tdSql.query("select * from t1 where c5 between '~' and 'ˆ'") + tdSql.query("select * from t1 where c5 between '~' and '^'") tdSql.checkRows(0) tdSql.query("select * from t1 where c5 not between 1 and 2") # tdSql.checkRows(0) From dba4464d8f4629d99ec4f4b9eea096a5dc45d201 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 7 Jun 2022 13:12:31 +0800 Subject: [PATCH 4/5] fix(os): add win32 query case --- tests/system-test/fulltest.bat | 66 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/system-test/fulltest.bat b/tests/system-test/fulltest.bat index b94e849472..3fc30268f7 100644 --- a/tests/system-test/fulltest.bat +++ b/tests/system-test/fulltest.bat @@ -28,7 +28,7 @@ python3 .\test.py -f 2-query\char_length.py python3 .\test.py -f 2-query\upper.py python3 .\test.py -f 2-query\lower.py python3 .\test.py -f 2-query\join.py -python3 .\test.py -f 2-query\join2.py +@REM python3 .\test.py -f 2-query\join2.py @REM python3 .\test.py -f 2-query\cast.py python3 .\test.py -f 2-query\union.py python3 .\test.py -f 2-query\union1.py @@ -42,51 +42,51 @@ python3 .\test.py -f 2-query\hyperloglog.py @REM python3 .\test.py -f 2-query\timezone.py -@REM python3 .\test.py -f 2-query\Now.py -@REM python3 .\test.py -f 2-query\Today.py -@REM python3 .\test.py -f 2-query\max.py -@REM python3 .\test.py -f 2-query\min.py -@REM python3 .\test.py -f 2-query\count.py -@REM python3 .\test.py -f 2-query\last.py -@REM python3 .\test.py -f 2-query\first.py -@REM python3 .\test.py -f 2-query\To_iso8601.py -@REM python3 .\test.py -f 2-query\To_unixtimestamp.py -@REM python3 .\test.py -f 2-query\timetruncate.py -@REM python3 .\test.py -f 2-query\diff.py -@REM python3 .\test.py -f 2-query\Timediff.py +python3 .\test.py -f 2-query\Now.py +python3 .\test.py -f 2-query\Today.py +python3 .\test.py -f 2-query\max.py +python3 .\test.py -f 2-query\min.py +python3 .\test.py -f 2-query\count.py +python3 .\test.py -f 2-query\last.py +python3 .\test.py -f 2-query\first.py +python3 .\test.py -f 2-query\To_iso8601.py +python3 .\test.py -f 2-query\To_unixtimestamp.py +python3 .\test.py -f 2-query\timetruncate.py +python3 .\test.py -f 2-query\diff.py +python3 .\test.py -f 2-query\Timediff.py -@REM python3 .\test.py -f 2-query\top.py -@REM python3 .\test.py -f 2-query\bottom.py -@REM python3 .\test.py -f 2-query\percentile.py -@REM python3 .\test.py -f 2-query\apercentile.py -@REM python3 .\test.py -f 2-query\abs.py -@REM python3 .\test.py -f 2-query\ceil.py +python3 .\test.py -f 2-query\top.py +python3 .\test.py -f 2-query\bottom.py +python3 .\test.py -f 2-query\percentile.py +python3 .\test.py -f 2-query\apercentile.py +python3 .\test.py -f 2-query\abs.py +python3 .\test.py -f 2-query\ceil.py @REM python3 .\test.py -f 2-query\floor.py -@REM python3 .\test.py -f 2-query\round.py +python3 .\test.py -f 2-query\round.py @REM python3 .\test.py -f 2-query\log.py -@REM python3 .\test.py -f 2-query\pow.py -@REM python3 .\test.py -f 2-query\sqrt.py +python3 .\test.py -f 2-query\pow.py +python3 .\test.py -f 2-query\sqrt.py @REM python3 .\test.py -f 2-query\sin.py -@REM python3 .\test.py -f 2-query\cos.py +python3 .\test.py -f 2-query\cos.py @REM python3 .\test.py -f 2-query\tan.py -@REM python3 .\test.py -f 2-query\arcsin.py +python3 .\test.py -f 2-query\arcsin.py @REM python3 .\test.py -f 2-query\arccos.py -@REM python3 .\test.py -f 2-query\arctan.py -@REM python3 .\test.py -f 2-query\query_cols_tags_and_or.py +python3 .\test.py -f 2-query\arctan.py +python3 .\test.py -f 2-query\query_cols_tags_and_or.py @REM # python3 .\test.py -f 2-query\nestedQuery.py @REM # TD-15983 subquery output duplicate name column. @REM # Please Xiangyang Guo modify the following script @REM # python3 .\test.py -f 2-query\nestedQuery_str.py @REM python3 .\test.py -f 2-query\avg.py -@REM python3 .\test.py -f 2-query\elapsed.py +python3 .\test.py -f 2-query\elapsed.py @REM python3 .\test.py -f 2-query\csum.py -@REM python3 .\test.py -f 2-query\mavg.py -@REM python3 .\test.py -f 2-query\diff.py -@REM python3 .\test.py -f 2-query\sample.py -@REM python3 .\test.py -f 2-query\function_diff.py -@REM python3 .\test.py -f 2-query\unique.py -@REM python3 .\test.py -f 2-query\stateduration.py +python3 .\test.py -f 2-query\mavg.py +python3 .\test.py -f 2-query\diff.py +python3 .\test.py -f 2-query\sample.py +python3 .\test.py -f 2-query\function_diff.py +python3 .\test.py -f 2-query\unique.py +python3 .\test.py -f 2-query\stateduration.py @REM python3 .\test.py -f 2-query\function_stateduration.py @REM python3 .\test.py -f 2-query\statecount.py From 43df05c161f40dc511b1bc5bffc780dd7083b0fb Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Tue, 7 Jun 2022 16:22:20 +0800 Subject: [PATCH 5/5] fix(os): add win32 query case --- tests/pytest/util/dnodes.py | 2 +- tests/system-test/2-query/cast.py | 8 +-- tests/system-test/fulltest.bat | 102 +++++++++++++++--------------- tests/system-test/test-all.bat | 31 ++++++++- 4 files changed, 86 insertions(+), 57 deletions(-) diff --git a/tests/pytest/util/dnodes.py b/tests/pytest/util/dnodes.py index 63b841cfc5..c2aed6555d 100644 --- a/tests/pytest/util/dnodes.py +++ b/tests/pytest/util/dnodes.py @@ -416,7 +416,7 @@ class TDDnode: psCmd, shell=True).decode("utf-8") if not platform.system().lower() == 'windows': for port in range(6030, 6041): - fuserCmd = "fuser -k -n tcp %d" % port + fuserCmd = "fuser -k -n tcp %d > /dev/null" % port os.system(fuserCmd) if self.valgrind: time.sleep(2) diff --git a/tests/system-test/2-query/cast.py b/tests/system-test/2-query/cast.py index e07ab95f45..387170991f 100644 --- a/tests/system-test/2-query/cast.py +++ b/tests/system-test/2-query/cast.py @@ -565,7 +565,7 @@ class TDTestCase: if data_ct4_c10[i] is None: tdSql.checkData( i, 0, None ) else: - time2str = str(int(datetime.datetime.timestamp(data_ct4_c10[i])*1000)) + time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000)) tdSql.checkData( i, 0, time2str ) tdSql.query("select cast(c10 as nchar(32)) as b from t1") for i in range(len(data_t1_c10)): @@ -574,7 +574,7 @@ class TDTestCase: elif i == 10: continue else: - time2str = str(int(datetime.datetime.timestamp(data_t1_c10[i])*1000)) + time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000)) tdSql.checkData( i, 0, time2str ) tdLog.printNoPrefix("==========step38: cast timestamp to binary, expect no changes ") @@ -583,7 +583,7 @@ class TDTestCase: if data_ct4_c10[i] is None: tdSql.checkData( i, 0, None ) else: - time2str = str(int(datetime.datetime.timestamp(data_ct4_c10[i])*1000)) + time2str = str(int((data_ct4_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000)) tdSql.checkData( i, 0, time2str ) tdSql.query("select cast(c10 as binary(32)) as b from t1") for i in range(len(data_t1_c10)): @@ -592,7 +592,7 @@ class TDTestCase: elif i == 10: continue else: - time2str = str(int(datetime.datetime.timestamp(data_t1_c10[i])*1000)) + time2str = str(int((data_t1_c10[i]-datetime.datetime.fromtimestamp(0)).total_seconds()*1000)) tdSql.checkData( i, 0, time2str ) tdLog.printNoPrefix("==========step39: cast constant operation to bigint, expect change to int ") diff --git a/tests/system-test/fulltest.bat b/tests/system-test/fulltest.bat index 3fc30268f7..6ef66c58c2 100644 --- a/tests/system-test/fulltest.bat +++ b/tests/system-test/fulltest.bat @@ -18,75 +18,75 @@ python3 .\test.py -f 0-others\udf_restart_taosd.py @REM #python3 .\test.py -f 1-insert\test_stmt_muti_insert_query.py @REM python3 .\test.py -f 1-insert\alter_stable.py @REM python3 .\test.py -f 1-insert\alter_table.py -python3 .\test.py -f 2-query\between.py -python3 .\test.py -f 2-query\distinct.py -python3 .\test.py -f 2-query\varchar.py -python3 .\test.py -f 2-query\ltrim.py -python3 .\test.py -f 2-query\rtrim.py -python3 .\test.py -f 2-query\length.py -python3 .\test.py -f 2-query\char_length.py -python3 .\test.py -f 2-query\upper.py -python3 .\test.py -f 2-query\lower.py -python3 .\test.py -f 2-query\join.py +@REM python3 .\test.py -f 2-query\between.py +@REM python3 .\test.py -f 2-query\distinct.py +@REM python3 .\test.py -f 2-query\varchar.py +@REM python3 .\test.py -f 2-query\ltrim.py +@REM python3 .\test.py -f 2-query\rtrim.py +@REM python3 .\test.py -f 2-query\length.py +@REM python3 .\test.py -f 2-query\char_length.py +@REM python3 .\test.py -f 2-query\upper.py +@REM python3 .\test.py -f 2-query\lower.py +@REM python3 .\test.py -f 2-query\join.py @REM python3 .\test.py -f 2-query\join2.py @REM python3 .\test.py -f 2-query\cast.py -python3 .\test.py -f 2-query\union.py -python3 .\test.py -f 2-query\union1.py -python3 .\test.py -f 2-query\concat.py -python3 .\test.py -f 2-query\concat2.py -python3 .\test.py -f 2-query\concat_ws.py -python3 .\test.py -f 2-query\concat_ws2.py -python3 .\test.py -f 2-query\check_tsdb.py -python3 .\test.py -f 2-query\spread.py -python3 .\test.py -f 2-query\hyperloglog.py +@REM python3 .\test.py -f 2-query\union.py +@REM python3 .\test.py -f 2-query\union1.py +@REM python3 .\test.py -f 2-query\concat.py +@REM python3 .\test.py -f 2-query\concat2.py +@REM python3 .\test.py -f 2-query\concat_ws.py +@REM python3 .\test.py -f 2-query\concat_ws2.py +@REM python3 .\test.py -f 2-query\check_tsdb.py +@REM python3 .\test.py -f 2-query\spread.py +@REM python3 .\test.py -f 2-query\hyperloglog.py @REM python3 .\test.py -f 2-query\timezone.py -python3 .\test.py -f 2-query\Now.py -python3 .\test.py -f 2-query\Today.py -python3 .\test.py -f 2-query\max.py -python3 .\test.py -f 2-query\min.py -python3 .\test.py -f 2-query\count.py -python3 .\test.py -f 2-query\last.py -python3 .\test.py -f 2-query\first.py -python3 .\test.py -f 2-query\To_iso8601.py -python3 .\test.py -f 2-query\To_unixtimestamp.py -python3 .\test.py -f 2-query\timetruncate.py -python3 .\test.py -f 2-query\diff.py -python3 .\test.py -f 2-query\Timediff.py +@REM python3 .\test.py -f 2-query\Now.py +@REM python3 .\test.py -f 2-query\Today.py +@REM python3 .\test.py -f 2-query\max.py +@REM python3 .\test.py -f 2-query\min.py +@REM python3 .\test.py -f 2-query\count.py +@REM python3 .\test.py -f 2-query\last.py +@REM python3 .\test.py -f 2-query\first.py +@REM python3 .\test.py -f 2-query\To_iso8601.py +@REM python3 .\test.py -f 2-query\To_unixtimestamp.py +@REM python3 .\test.py -f 2-query\timetruncate.py +@REM python3 .\test.py -f 2-query\diff.py +@REM python3 .\test.py -f 2-query\Timediff.py -python3 .\test.py -f 2-query\top.py -python3 .\test.py -f 2-query\bottom.py -python3 .\test.py -f 2-query\percentile.py -python3 .\test.py -f 2-query\apercentile.py -python3 .\test.py -f 2-query\abs.py -python3 .\test.py -f 2-query\ceil.py +@REM python3 .\test.py -f 2-query\top.py +@REM python3 .\test.py -f 2-query\bottom.py +@REM python3 .\test.py -f 2-query\percentile.py +@REM python3 .\test.py -f 2-query\apercentile.py +@REM python3 .\test.py -f 2-query\abs.py +@REM python3 .\test.py -f 2-query\ceil.py @REM python3 .\test.py -f 2-query\floor.py -python3 .\test.py -f 2-query\round.py +@REM python3 .\test.py -f 2-query\round.py @REM python3 .\test.py -f 2-query\log.py -python3 .\test.py -f 2-query\pow.py -python3 .\test.py -f 2-query\sqrt.py +@REM python3 .\test.py -f 2-query\pow.py +@REM python3 .\test.py -f 2-query\sqrt.py @REM python3 .\test.py -f 2-query\sin.py -python3 .\test.py -f 2-query\cos.py +@REM python3 .\test.py -f 2-query\cos.py @REM python3 .\test.py -f 2-query\tan.py -python3 .\test.py -f 2-query\arcsin.py +@REM python3 .\test.py -f 2-query\arcsin.py @REM python3 .\test.py -f 2-query\arccos.py -python3 .\test.py -f 2-query\arctan.py -python3 .\test.py -f 2-query\query_cols_tags_and_or.py +@REM python3 .\test.py -f 2-query\arctan.py +@REM python3 .\test.py -f 2-query\query_cols_tags_and_or.py @REM # python3 .\test.py -f 2-query\nestedQuery.py @REM # TD-15983 subquery output duplicate name column. @REM # Please Xiangyang Guo modify the following script @REM # python3 .\test.py -f 2-query\nestedQuery_str.py @REM python3 .\test.py -f 2-query\avg.py -python3 .\test.py -f 2-query\elapsed.py +@REM python3 .\test.py -f 2-query\elapsed.py @REM python3 .\test.py -f 2-query\csum.py -python3 .\test.py -f 2-query\mavg.py -python3 .\test.py -f 2-query\diff.py -python3 .\test.py -f 2-query\sample.py -python3 .\test.py -f 2-query\function_diff.py -python3 .\test.py -f 2-query\unique.py -python3 .\test.py -f 2-query\stateduration.py +@REM python3 .\test.py -f 2-query\mavg.py +@REM python3 .\test.py -f 2-query\diff.py +@REM python3 .\test.py -f 2-query\sample.py +@REM python3 .\test.py -f 2-query\function_diff.py +@REM python3 .\test.py -f 2-query\unique.py +@REM python3 .\test.py -f 2-query\stateduration.py @REM python3 .\test.py -f 2-query\function_stateduration.py @REM python3 .\test.py -f 2-query\statecount.py diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index baafbc9e08..9c2e58ea3f 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -13,6 +13,9 @@ echo Linux Taosd Test for /F "usebackq tokens=*" %%i in (fulltest.bat) do ( for /f "tokens=1* delims= " %%a in ("%%i") do if not "%%a" == "@REM" ( echo Processing %%i + call :GetTimeSeconds %time% + set time1=!_timeTemp! + echo Start at %time% set /a a+=1 call %%i ARG1 -m %1 > result_!a!.txt 2>error_!a!.txt if errorlevel 1 ( call :colorEcho 0c "failed" &echo. && echo result: && cat result_!a!.txt && echo error: && cat error_!a!.txt && exit 8 ) else ( call :colorEcho 0a "Success" &echo. ) @@ -21,7 +24,33 @@ for /F "usebackq tokens=*" %%i in (fulltest.bat) do ( exit :colorEcho +call :GetTimeSeconds %time% +set time2=%_timeTemp% +set /a interTime=%time2% - %time1% +echo End at %time% , cast %interTime%s echo off "%~2" findstr /v /a:%1 /R "^$" "%~2" nul -del "%~2" > nul 2>&1i \ No newline at end of file +del "%~2" > nul 2>&1i +goto :eof + +:GetTimeSeconds +set tt=%1 +set tt=%tt:.= % +set tt=%tt::= % +set index=1 +for %%a in (%tt%) do ( + if !index! EQU 1 ( + set hh=%%a + )^ + else if !index! EQU 2 ( + set mm=%%a + + )^ + else if !index! EQU 3 ( + set ss=%%a + ) + set /a index=index+1 +) +set /a _timeTemp=(%hh%*60+%mm%)*60+%ss% +goto :eof \ No newline at end of file