test:modify testcase of python connector using Statement API
This commit is contained in:
parent
7830675720
commit
c6f21c4969
|
@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -132,11 +132,11 @@ class TDTestCase:
|
||||||
querystmt.bind_param(queryparam)
|
querystmt.bind_param(queryparam)
|
||||||
querystmt.execute()
|
querystmt.execute()
|
||||||
result=querystmt.use_result()
|
result=querystmt.use_result()
|
||||||
rows=result.fetch_all()
|
# rows=result.fetch_all()
|
||||||
print( querystmt.use_result())
|
# print( querystmt.use_result())
|
||||||
|
|
||||||
# result = conn.query("select * from log")
|
# result = conn.query("select * from log")
|
||||||
# rows=result.fetch_all()
|
rows=result.fetch_all()
|
||||||
# rows=result.fetch_all()
|
# rows=result.fetch_all()
|
||||||
print(rows)
|
print(rows)
|
||||||
assert rows[1][0] == "ts"
|
assert rows[1][0] == "ts"
|
||||||
|
@ -247,10 +247,9 @@ class TDTestCase:
|
||||||
config = buildPath+ "../sim/dnode1/cfg/"
|
config = buildPath+ "../sim/dnode1/cfg/"
|
||||||
host="localhost"
|
host="localhost"
|
||||||
connectstmt=self.newcon(host,config)
|
connectstmt=self.newcon(host,config)
|
||||||
print(connectstmt)
|
|
||||||
self.test_stmt_insert_multi(connectstmt)
|
self.test_stmt_insert_multi(connectstmt)
|
||||||
connectstmt=self.newcon(host,config)
|
# connectstmt=self.newcon(host,config)
|
||||||
self.test_stmt_set_tbname_tag(connectstmt)
|
# self.test_stmt_set_tbname_tag(connectstmt)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -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 0-others/fsync.py
|
||||||
|
|
||||||
python3 ./test.py -f 1-insert/opentsdb_telnet_line_taosc_insert.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/between.py
|
||||||
python3 ./test.py -f 2-query/distinct.py
|
python3 ./test.py -f 2-query/distinct.py
|
||||||
|
|
Loading…
Reference in New Issue