From cc8a315c3e2012d07be35e09beac7daab2d4e0a9 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 13 Aug 2020 17:12:01 +0800 Subject: [PATCH] TD-1113: Add taosdemo into daily test --- tests/pytest/fulltest.sh | 3 +++ tests/pytest/regressiontest.sh | 3 +++ tests/pytest/tools/taosdemo.py | 44 ++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 tests/pytest/tools/taosdemo.py diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 8e0f6314e0..fd5aa4ecf0 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -183,3 +183,6 @@ python3 ./test.py -f functions/function_stddev.py python3 ./test.py -f functions/function_sum.py python3 ./test.py -f functions/function_top.py python3 ./test.py -f functions/function_twa.py + +# tools +python3 test.py -f tools/taosdemo.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index 20f4b4dc3b..b69ee37a55 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -177,3 +177,6 @@ python3 ./test.py -f functions/function_stddev.py python3 ./test.py -f functions/function_sum.py python3 ./test.py -f functions/function_top.py python3 ./test.py -f functions/function_twa.py + +# tools +python3 test.py -f tools/taosdemo.py \ No newline at end of file diff --git a/tests/pytest/tools/taosdemo.py b/tests/pytest/tools/taosdemo.py new file mode 100644 index 0000000000..54d33c90f3 --- /dev/null +++ b/tests/pytest/tools/taosdemo.py @@ -0,0 +1,44 @@ +################################################################### +# 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 -*- + +import sys +import os +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + self.numberOfTables = 10000 + self.numberOfRecords = 100 + + def run(self): + tdSql.prepare() + + os.system("yes | taosdemo -t %d -n %d" % (self.numberOfTables, self.numberOfRecords)) + + tdSql.execute("use test") + tdSql.query("select count(*) from meters") + tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) -- GitLab