add case TD-31660

This commit is contained in:
Leo Xu 2024-08-30 16:31:31 +08:00
parent a250823fb5
commit 7fa3eddaf6
3 changed files with 172 additions and 0 deletions

View File

@ -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())

View File

@ -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"
]
}
]
}
]
}
]
}

View File

@ -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 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/window/base.py
#
# system test