From 748fadeeff8e0e8e9208a7f14bc3258df30007e2 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Mon, 5 Jul 2021 17:07:39 +0800 Subject: [PATCH] fix taosdemoPerformance.py runtime error --- tests/pytest/query/queryPerformance.py | 11 +++++++++++ tests/pytest/tools/taosdemoPerformance.py | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/pytest/query/queryPerformance.py b/tests/pytest/query/queryPerformance.py index 720ae745cb..f3e8fed24c 100644 --- a/tests/pytest/query/queryPerformance.py +++ b/tests/pytest/query/queryPerformance.py @@ -45,28 +45,39 @@ class taosdemoQueryPerformace: sql = "select count(*) from test.meters" tableid = 1 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" tableid = 2 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'" tableid = 3 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" tableid = 4 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)" tableid = 5 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" tableid = 6 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" tableid = 7 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'" tableid = 8 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() def query(self): diff --git a/tests/pytest/tools/taosdemoPerformance.py b/tests/pytest/tools/taosdemoPerformance.py index c4b125969a..f5eaec0ee6 100644 --- a/tests/pytest/tools/taosdemoPerformance.py +++ b/tests/pytest/tools/taosdemoPerformance.py @@ -16,7 +16,8 @@ import pandas as pd import argparse import os.path import json - +from util.log import tdLog +from util.sql import tdSql class taosdemoPerformace: def __init__(self, commitID, dbName): @@ -121,7 +122,6 @@ class taosdemoPerformace: return buildPath def insertData(self): - tdSql.prepare() buildPath = self.getBuildPath() if (buildPath == ""): tdLog.exit("taosdemo not found!") -- GitLab