From c6f21c4969867038b718201b0bd06d551d4c4558 Mon Sep 17 00:00:00 2001 From: tomchon Date: Mon, 30 May 2022 13:27:53 +0800 Subject: [PATCH] test:modify testcase of python connector using Statement API --- .../1-insert/performanceInsert.json | 79 +++++++++++++++++++ .../1-insert/performanceQuery.json | 42 ++++++++++ .../1-insert/test_stmt_insert_query.py | 11 ++- tests/system-test/fulltest.sh | 1 + 4 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 tests/system-test/1-insert/performanceInsert.json create mode 100644 tests/system-test/1-insert/performanceQuery.json diff --git a/tests/system-test/1-insert/performanceInsert.json b/tests/system-test/1-insert/performanceInsert.json new file mode 100644 index 0000000000..de410c30f2 --- /dev/null +++ b/tests/system-test/1-insert/performanceInsert.json @@ -0,0 +1,79 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos/", + "host": "test216", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 8, + "thread_count_create_tbl": 8, + "result_file": "./insert_res.txt", + "confirm_parameter_prompt": "no", + "insert_interval": 0, + "interlace_rows": 1000, + "num_of_records_per_req": 100000, + "databases": [ + { + "dbinfo": { + "name": "db", + "drop": "yes", + "vgroups": 24 + }, + "super_tables": [ + { + "name": "stb", + "child_table_exists": "no", + "childtable_count": 100000, + "childtable_prefix": "stb_", + "auto_create_table": "no", + "batch_create_tbl_num": 50000, + "data_source": "rand", + "insert_mode": "taosc", + "insert_rows": 5, + "interlace_rows": 100000, + "insert_interval": 0, + "max_sql_len": 10000000, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 10, + "start_timestamp": "2022-05-01 00:00:00.000", + "sample_format": "csv", + "use_sample_ts": "no", + "tags_file": "", + "columns": [ + { + "type": "INT" + }, + { + "type": "TINYINT", + "count": 1 + }, + {"type": "DOUBLE"}, + + { + "type": "BINARY", + "len": 40, + "count": 1 + }, + { + "type": "nchar", + "len": 20, + "count": 1 + } + ], + "tags": [ + { + "type": "TINYINT", + "count": 1 + }, + { + "type": "BINARY", + "len": 16, + "count": 1 + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/system-test/1-insert/performanceQuery.json b/tests/system-test/1-insert/performanceQuery.json new file mode 100644 index 0000000000..fe2991bd0f --- /dev/null +++ b/tests/system-test/1-insert/performanceQuery.json @@ -0,0 +1,42 @@ +{ + "filetype": "query", + "cfgdir": "/etc/taos", + "host": "test216", + "port": 6030, + "user": "root", + "password": "taosdata", + "confirm_parameter_prompt": "no", + "databases": "db", + "query_times": 100, + "query_mode": "taosc", + "specified_table_query": { + "query_interval": 0, + "threads": 8, + "sqls": [ + { + "sql": "select count(*) from stb_0 ", + "result": "./query_res0.txt" + }, + { + "sql": "select last_row(*) from stb_1 ", + "result": "./query_res1.txt" + }, + { + "sql": "select last(*) from stb_2 ", + "result": "./query_res2.txt" + }, + { + "sql": "select first(*) from stb_3 ", + "result": "./query_res3.txt" + }, + { + "sql": "select avg(c0),min(c2),max(c1) from stb_4", + "result": "./query_res4.txt" + }, + { + "sql": "select avg(c0),min(c2),max(c1) from stb_5 where ts <= '2022-05-01 20:00:00.500' and ts >= '2022-05-01 00:00:00.000' ", + "result": "./query_res5.txt" + } + ] + } +} \ No newline at end of file diff --git a/tests/system-test/1-insert/test_stmt_insert_query.py b/tests/system-test/1-insert/test_stmt_insert_query.py index c6faedd35e..90f168eecf 100644 --- a/tests/system-test/1-insert/test_stmt_insert_query.py +++ b/tests/system-test/1-insert/test_stmt_insert_query.py @@ -132,11 +132,11 @@ class TDTestCase: querystmt.bind_param(queryparam) querystmt.execute() result=querystmt.use_result() - rows=result.fetch_all() - print( querystmt.use_result()) + # rows=result.fetch_all() + # print( querystmt.use_result()) # result = conn.query("select * from log") - # rows=result.fetch_all() + rows=result.fetch_all() # rows=result.fetch_all() print(rows) assert rows[1][0] == "ts" @@ -247,10 +247,9 @@ class TDTestCase: config = buildPath+ "../sim/dnode1/cfg/" host="localhost" connectstmt=self.newcon(host,config) - print(connectstmt) self.test_stmt_insert_multi(connectstmt) - connectstmt=self.newcon(host,config) - self.test_stmt_set_tbname_tag(connectstmt) + # connectstmt=self.newcon(host,config) + # self.test_stmt_set_tbname_tag(connectstmt) return diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 6331086fb3..466a1bcfc6 100644 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -15,6 +15,7 @@ python3 ./test.py -f 0-others/user_control.py python3 ./test.py -f 0-others/fsync.py python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.py +python3 ./test.py -f 1-insert/test_stmt_insert_query.py python3 ./test.py -f 2-query/between.py python3 ./test.py -f 2-query/distinct.py -- GitLab