未验证 提交 ad7e6638 编写于 作者: Y Yang Zhao 提交者: GitHub

[TD-12318]<test>(tools): update taos-tools (#9514)

* [TD-12318]<test>(tools): update taos-tools

* [TD-12318]<test>(tools): modify taosdemo test cases

* [TD-12318]<test>(tools): modify taosdemo test cases

* [TD-12318]<test>(tools): merge develop
上级 d9ef6b7e
......@@ -16,14 +16,14 @@ python3 test.py -f tools/taosdemoTestWithJson.py
python3 test.py -f tools/taosdemoTestLimitOffset.py
python3 test.py -f tools/taosdemoTestTblAlt.py
python3 test.py -f tools/taosdemoTestSampleData.py
#python3 test.py -f tools/taosdemoTestInterlace.py
# python3 test.py -f tools/taosdemoTestQuery.py
python3 test.py -f tools/taosdemoTestInterlace.py
python3 test.py -f tools/taosdemoTestQuery.py
python3 ./test.py -f tools/taosdemoTestdatatype.py
#======================p2-end===============
#======================p3-start===============
# nano support
#python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoInsert.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanoQuery.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestSupportNanosubscribe.py
python3 test.py -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestInsertTime_step.py
......@@ -32,14 +32,13 @@ python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py
#======================p3-end===============
#======================p4-start===============
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertAllType.py
python3 test.py -f tools/taosdemoAllTest/TD-4985/query-limit-offset.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
python3 test.py -f tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
#python3 test.py -f tools/taosdemoAllTest/TD-10539/creatfe_taosdemo.py
#python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonStmt.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJsonSml.py
python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertShell.py
......
......@@ -12,7 +12,7 @@
# -*- coding: utf-8 -*-
import sys
import os
import os, time
from util.log import *
from util.cases import *
from util.sql import *
......@@ -107,6 +107,7 @@ class TDTestCase:
# insert by csv files and timetamp is long int , strings in ts and
# cols
os.system(
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
binPath)
......@@ -117,9 +118,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP")
tdSql.query(
"select count(*) from stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
"select count(*) from nsdbcsv.stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000)
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000)
......@@ -134,31 +137,9 @@ class TDTestCase:
binPath)
tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600)
# check taosdemo -s
sqls_ls = [
'drop database if exists nsdbsql;',
'create database nsdbsql precision "ns" keep 3600 days 6 update 1;',
'use nsdbsql;',
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);',
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 85, 32, 0.76);']
with open("./taosdemoTestNanoCreateDB.sql", mode="a") as sql_files:
for sql in sqls_ls:
sql_files.write(sql + "\n")
sql_files.close()
sleep(10)
os.system("%staosBenchmark -s taosdemoTestNanoCreateDB.sql -y " % binPath)
tdSql.query("select count(*) from nsdbsql.meters")
tdSql.checkData(0, 0, 2)
os.system("rm -rf ./res.txt")
os.system("rm -rf ./*.py.sql")
os.system("rm -rf ./taosdemoTestNanoCreateDB.sql")
def stop(self):
tdSql.close()
......
......@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}]
"tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
......@@ -81,8 +81,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "TINYINT", "count":1}],
"tags": [{"type": "TINYINT", "count":1}]
"columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb2",
......@@ -108,7 +108,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}]
"tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb3",
......@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}]
"tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb4",
......@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}]
"tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb5",
......@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}]
"tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb6",
......@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}]
"tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb7",
......@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "BOOL"}],
"tags": [{"type": "BOOL", "count":1}]
"columns": [ {"type": "INT"}],
"tags": [{"type": "INT", "count":3}]
},
{
"name": "stb8",
......@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}],
"tags": [{"type": "NCHAR", "count":1}]
"columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
......@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}],
"tags": [{"type": "BINARY", "count":1}]
"columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
......@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}]
"tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
......@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}]
"tags": [{"type": "UTINYINT", "count":3}]
},
{
"name": "stb12",
......@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}]
"tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
......@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}]
"tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
......@@ -82,7 +82,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}]
"tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb2",
......@@ -107,8 +107,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "TINYINT", "count":1}],
"tags": [{"type": "TINYINT", "count":1}]
"columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb3",
......@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}]
"tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb4",
......@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}]
"tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb5",
......@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}]
"tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb6",
......@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}]
"tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb7",
......@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "BOOL"}],
"tags": [{"type": "BOOL", "count":1}]
"columns": [ {"type": "int"}],
"tags": [{"type": "int", "count":6}]
},
{
"name": "stb8",
......@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}],
"tags": [{"type": "NCHAR", "count":1}]
"columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
......@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}],
"tags": [{"type": "BINARY", "count":1}]
"columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
......@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}]
"tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
......@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}]
"tags": [{"type": "UTINYINT", "count":6}]
},
{
"name": "stb12",
......@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}]
"tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
......@@ -268,16 +268,16 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
tdSql.query("select * from stb1 where t1=-127")
tdSql.checkRows(20)
tdSql.query("select * from stb1 where t2=127")
tdSql.checkRows(10)
tdSql.query("select * from stb1 where t2=126")
tdSql.checkRows(10)
#os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
#tdSql.execute("use dbtest123")
#tdSql.query("select c2 from stb0")
#tdSql.checkData(0, 0, 2147483647)
#tdSql.query("select * from stb1 where t1=-127")
#tdSql.checkRows(20)
#tdSql.query("select * from stb1 where t2=127")
#tdSql.checkRows(10)
#tdSql.query("select * from stb1 where t2=126")
#tdSql.checkRows(10)
# insert: test interlace parament
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册