未验证 提交 e34cb5a7 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #6745 from taosdata/xiaoping/test_case

fix taosdemoPerformance.py runtime error
...@@ -45,28 +45,39 @@ class taosdemoQueryPerformace: ...@@ -45,28 +45,39 @@ class taosdemoQueryPerformace:
sql = "select count(*) from test.meters" sql = "select count(*) from test.meters"
tableid = 1 tableid = 1
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select avg(f1), max(f2), min(f3) from test.meters" sql = "select avg(f1), max(f2), min(f3) from test.meters"
tableid = 2 tableid = 2
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select count(*) from test.meters where loc='beijing'" sql = "select count(*) from test.meters where loc='beijing'"
tableid = 3 tableid = 3
cursor.execute("create table if not exists %s%d using %s tags(%d, \"%s\")" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, \"%s\")" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select avg(f1), max(f2), min(f3) from test.meters where areaid=10" sql = "select avg(f1), max(f2), min(f3) from test.meters where areaid=10"
tableid = 4 tableid = 4
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select avg(f1), max(f2), min(f3) from test.t10 interval(10s)" sql = "select avg(f1), max(f2), min(f3) from test.t10 interval(10s)"
tableid = 5 tableid = 5
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select last_row(*) from meters" sql = "select last_row(*) from meters"
tableid = 6 tableid = 6
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select * from meters" sql = "select * from meters"
tableid = 7 tableid = 7
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select avg(f1), max(f2), min(f3) from meters where ts <= '2017-07-15 10:40:01.000' and ts <= '2017-07-15 14:00:40.000'" sql = "select avg(f1), max(f2), min(f3) from meters where ts <= '2017-07-15 10:40:01.000' and ts <= '2017-07-15 14:00:40.000'"
tableid = 8 tableid = 8
cursor.execute("create table if not exists %s%d using %s tags(%d, \"%s\")" % (self.tbPerfix, tableid, self.stbName, tableid, sql)) cursor.execute("create table if not exists %s%d using %s tags(%d, \"%s\")" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
sql = "select last(*) from meters"
tableid = 9
cursor.execute("create table if not exists %s%d using %s tags(%d, '%s')" % (self.tbPerfix, tableid, self.stbName, tableid, sql))
cursor.close() cursor.close()
def query(self): def query(self):
......
...@@ -16,7 +16,8 @@ import pandas as pd ...@@ -16,7 +16,8 @@ import pandas as pd
import argparse import argparse
import os.path import os.path
import json import json
from util.log import tdLog
from util.sql import tdSql
class taosdemoPerformace: class taosdemoPerformace:
def __init__(self, commitID, dbName): def __init__(self, commitID, dbName):
...@@ -121,7 +122,6 @@ class taosdemoPerformace: ...@@ -121,7 +122,6 @@ class taosdemoPerformace:
return buildPath return buildPath
def insertData(self): def insertData(self):
tdSql.prepare()
buildPath = self.getBuildPath() buildPath = self.getBuildPath()
if (buildPath == ""): if (buildPath == ""):
tdLog.exit("taosdemo not found!") tdLog.exit("taosdemo not found!")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册