Merge pull request #27582 from taosdata/test/3.0/TD-31660
add case by TD-31660 TS-5340
This commit is contained in:
commit
26835e6e5f
|
@ -19,7 +19,6 @@ import taos
|
||||||
import frame
|
import frame
|
||||||
import frame.etool
|
import frame.etool
|
||||||
|
|
||||||
|
|
||||||
from frame.log import *
|
from frame.log import *
|
||||||
from frame.cases import *
|
from frame.cases import *
|
||||||
from frame.sql import *
|
from frame.sql import *
|
||||||
|
@ -29,14 +28,13 @@ from frame import *
|
||||||
|
|
||||||
class TDTestCase(TBase):
|
class TDTestCase(TBase):
|
||||||
updatecfgDict = {
|
updatecfgDict = {
|
||||||
"keepColumnName" : "1",
|
"keepColumnName": "1",
|
||||||
"ttlChangeOnWrite" : "1",
|
"ttlChangeOnWrite": "1",
|
||||||
"querySmaOptimize" : "1",
|
"querySmaOptimize": "1",
|
||||||
"slowLogScope" : "none",
|
"slowLogScope": "none",
|
||||||
"queryBufferSize" : 10240
|
"queryBufferSize": 10240
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def insertData(self):
|
def insertData(self):
|
||||||
tdLog.info(f"insert data.")
|
tdLog.info(f"insert data.")
|
||||||
# taosBenchmark run
|
# taosBenchmark run
|
||||||
|
@ -508,6 +506,11 @@ class TDTestCase(TBase):
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
tdSql.checkData(0, 0, None)
|
tdSql.checkData(0, 0, None)
|
||||||
|
|
||||||
|
def test_error(self):
|
||||||
|
tdSql.error(
|
||||||
|
"select * from (select to_iso8601(ts, timezone()), timezone() from meters order by ts desc) limit 1000;",
|
||||||
|
expectErrInfo="Not supported timzone format") # TS-5340
|
||||||
|
|
||||||
# run
|
# run
|
||||||
def run(self):
|
def run(self):
|
||||||
tdLog.debug(f"start to excute {__file__}")
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
@ -547,8 +550,11 @@ class TDTestCase(TBase):
|
||||||
# agg function
|
# agg function
|
||||||
self.test_stddev()
|
self.test_stddev()
|
||||||
self.test_varpop()
|
self.test_varpop()
|
||||||
tdLog.success(f"{__file__} successfully executed")
|
|
||||||
|
|
||||||
|
# error function
|
||||||
|
self.test_error()
|
||||||
|
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
|
||||||
tdCases.addLinux(__file__, TDTestCase())
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
from frame.log import *
|
||||||
|
from frame.cases import *
|
||||||
|
from frame.sql import *
|
||||||
|
from frame import etool
|
||||||
|
|
||||||
|
|
||||||
|
class TDTestCase:
|
||||||
|
# init
|
||||||
|
def init(self, conn, logSql, replicaVar=1):
|
||||||
|
self.replicaVar = int(replicaVar)
|
||||||
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
tdSql.init(conn.cursor(), True)
|
||||||
|
# taosBenchmark run
|
||||||
|
tdLog.info(f"insert data.")
|
||||||
|
jfile = etool.curFile(__file__, "window.json")
|
||||||
|
etool.benchMark(json=jfile)
|
||||||
|
|
||||||
|
# run
|
||||||
|
def run(self):
|
||||||
|
# TD-31660
|
||||||
|
sql = "select _wstart,_wend,count(voltage),tbname from db.stb partition by tbname event_window start with voltage >2 end with voltage > 15 slimit 5 limit 5"
|
||||||
|
tdSql.query(sql)
|
||||||
|
tdSql.checkRows(25)
|
||||||
|
sql = "select _wstart,_wend,count(voltage),tbname from db.stb partition by tbname count_window(600) slimit 5 limit 5;"
|
||||||
|
tdSql.query(sql)
|
||||||
|
tdSql.checkRows(25)
|
||||||
|
|
||||||
|
# stop
|
||||||
|
def stop(self):
|
||||||
|
tdSql.execute("drop database db;")
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -0,0 +1,123 @@
|
||||||
|
{
|
||||||
|
"filetype": "insert",
|
||||||
|
"cfgdir": "/etc/taos",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 6030,
|
||||||
|
"user": "root",
|
||||||
|
"password": "taosdata",
|
||||||
|
"connection_pool_size": 8,
|
||||||
|
"num_of_records_per_req": 4000,
|
||||||
|
"prepared_rand": 10000,
|
||||||
|
"thread_count": 3,
|
||||||
|
"create_table_thread_count": 1,
|
||||||
|
"confirm_parameter_prompt": "no",
|
||||||
|
"databases": [
|
||||||
|
{
|
||||||
|
"dbinfo": {
|
||||||
|
"name": "db",
|
||||||
|
"drop": "yes",
|
||||||
|
"vgroups": 3,
|
||||||
|
"replica": 1,
|
||||||
|
"duration": "3d",
|
||||||
|
"wal_retention_period": 1,
|
||||||
|
"wal_retention_size": 1,
|
||||||
|
"stt_trigger": 1
|
||||||
|
},
|
||||||
|
"super_tables": [
|
||||||
|
{
|
||||||
|
"name": "stb",
|
||||||
|
"child_table_exists": "no",
|
||||||
|
"childtable_count": 6,
|
||||||
|
"insert_rows": 100000,
|
||||||
|
"childtable_prefix": "d",
|
||||||
|
"insert_mode": "taosc",
|
||||||
|
"timestamp_step": 30000,
|
||||||
|
"start_timestamp": 1700000000000,
|
||||||
|
"columns": [
|
||||||
|
{
|
||||||
|
"type": "bool",
|
||||||
|
"name": "bc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "float",
|
||||||
|
"name": "fc"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "double",
|
||||||
|
"name": "voltage",
|
||||||
|
"max": 250,
|
||||||
|
"min": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tinyint",
|
||||||
|
"name": "ti"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "smallint",
|
||||||
|
"name": "si"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "int",
|
||||||
|
"name": "ic"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "bigint",
|
||||||
|
"name": "bi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "utinyint",
|
||||||
|
"name": "uti"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "usmallint",
|
||||||
|
"name": "usi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "uint",
|
||||||
|
"name": "ui"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ubigint",
|
||||||
|
"name": "ubi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "binary",
|
||||||
|
"name": "bin",
|
||||||
|
"len": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "nchar",
|
||||||
|
"name": "nch",
|
||||||
|
"len": 16
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
{
|
||||||
|
"type": "tinyint",
|
||||||
|
"name": "groupid",
|
||||||
|
"max": 10,
|
||||||
|
"min": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "location",
|
||||||
|
"type": "binary",
|
||||||
|
"len": 16,
|
||||||
|
"values": [
|
||||||
|
"San Francisco",
|
||||||
|
"Los Angles",
|
||||||
|
"San Diego",
|
||||||
|
"San Jose",
|
||||||
|
"Palo Alto",
|
||||||
|
"Campbell",
|
||||||
|
"Mountain View",
|
||||||
|
"Sunnyvale",
|
||||||
|
"Santa Clara",
|
||||||
|
"Cupertino"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -41,6 +41,7 @@
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f tmq/tmqBugs.py -N 3
|
,,y,army,./pytest.sh python3 ./test.py -f tmq/tmqBugs.py -N 3
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_compare_asc_desc.py
|
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_compare_asc_desc.py
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/last/test_last.py
|
,,y,army,./pytest.sh python3 ./test.py -f query/last/test_last.py
|
||||||
|
,,y,army,./pytest.sh python3 ./test.py -f query/window/base.py
|
||||||
|
|
||||||
#
|
#
|
||||||
# system test
|
# system test
|
||||||
|
|
Loading…
Reference in New Issue