Merge pull request #2411 from taosdata/feature/sangshuduo/add-pytest-to-test-client

add client/client.py to test client functions.
This commit is contained in:
Shengliang Guan 2020-06-22 21:45:50 +08:00 committed by GitHub
commit 996c175a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,49 @@
###################################################################
# 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
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)
def run(self):
tdSql.prepare()
ret = tdSql.query('select database()')
tdSql.checkData(0, 0, "db")
ret = tdSql.query('select server_version()')
tdSql.checkData(0, 0, "2.0.0.0")
ret = tdSql.query('select client_version()')
tdSql.checkData(0, 0, "2.0.0.0")
ret = tdSql.query('select server_status()')
tdSql.checkData(0, 0, 1)
ret = tdSql.query('select server_status() as result')
tdSql.checkData(0, 0, 1)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())

View File

@ -1,6 +1,7 @@
#!/bin/bash
ulimit -c unlimited
python3 ./test.py -f client/client.py
python3 ./test.py -f insert/basic.py
python3 ./test.py -f insert/int.py
python3 ./test.py -f insert/float.py
@ -149,4 +150,4 @@ python3 ./test.py -f stream/stream1.py
python3 ./test.py -f stream/stream2.py
#alter table
python3 ./test.py -f alter/alter_table_crash.py
python3 ./test.py -f alter/alter_table_crash.py

View File

@ -1,6 +1,7 @@
#!/bin/bash
ulimit -c unlimited
python3 ./test.py -f client/client.py
python3 ./test.py -f insert/basic.py
python3 ./test.py -f insert/int.py
python3 ./test.py -f insert/float.py

View File

@ -1,6 +1,10 @@
#!/bin/bash
ulimit -c unlimited
# client
python3 ./test.py $1 -f client/client.py
python3 ./test.py $1 -s && sleep 1
# insert
python3 ./test.py $1 -f insert/basic.py
python3 ./test.py $1 -s && sleep 1

View File

@ -1,4 +1,9 @@
#!/bin/bash
# client
PYTHONMALLOC=malloc python3 ./test.py -g -f client/client.py
PYTHONMALLOC=malloc python3 ./test.py -g -s && sleep 1
# insert
PYTHONMALLOC=malloc python3 ./test.py -g -f insert/basic.py
PYTHONMALLOC=malloc python3 ./test.py -g -s && sleep 1