Adjust the log format of the test (#6309)

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
pull/6312/head^2
紫晴 2021-07-05 19:14:03 +08:00 committed by GitHub
parent 1f42b4ec9d
commit b5851d0e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 18 deletions

View File

@ -68,13 +68,14 @@ class Base:
if self.connection_wrap.get_connection(alias=DefaultConfig.DEFAULT_USING)[0] is None:
self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=param_info.param_host,
port=param_info.param_port)
if self.collection_wrap.collection is not None:
self.collection_wrap.drop(check_task='check_nothing')
self.collection_wrap.drop(check_task=ct.CheckTasks.check_nothing)
for collection_object in self.collection_object_list:
if collection_object.collection is not None \
and collection_object.name in self.utility_wrap.list_collections()[0]:
collection_object.drop(check_task='check_nothing')
collection_object.drop(check_task=ct.CheckTasks.check_nothing)
except Exception as e:
log.debug(str(e))
@ -116,15 +117,6 @@ class TestcaseBase(Base):
Public methods that can be used to add cases.
"""
# move to conftest.py
# @pytest.fixture(scope="module", params=ct.get_invalid_strs)
# def get_invalid_string(self, request):
# yield request.param
#
# @pytest.fixture(scope="module", params=cf.gen_simple_index())
# def get_index_param(self, request):
# yield request.param
def _connect(self):
""" Add an connection and create the connect """
res, is_succ = self.connection_wrap.connect(alias=DefaultConfig.DEFAULT_USING, host=param_info.param_host,

View File

@ -111,7 +111,7 @@ structure_metrics = ["SUBSTRUCTURE", "SUPERSTRUCTURE"]
class CheckTasks:
""" The name of the method used to check the result """
false = False
check_nothing = "check_nothing"
err_res = "error_response"
ccr = "check_connection_result"
check_collection_property = "check_collection_property"

View File

@ -1,5 +1,5 @@
[pytest]
addopts = --host 10.98.0.11 --html=/tmp/ci_logs/report.html --self-contained-html
addopts = --host 10.98.0.7 --html=/tmp/ci_logs/report.html --self-contained-html
# -;addopts = --host 172.28.255.155 --html=/tmp/report.html
# python3 -W ignore -m pytest

View File

@ -12,7 +12,7 @@ pytest-print==0.2.1
pytest-level==0.1.1
pytest-xdist==2.2.1
pytest-parallel
pymilvus-orm==2.0.0rc2.dev17
pymilvus-orm==2.0.0rc2.dev19
pytest-rerunfailures==9.1.1
git+https://github.com/Projectplace/pytest-tags
ndg-httpsclient

View File

@ -8,7 +8,7 @@ class Error:
self.message = getattr(error, 'message', str(error))
log_row_length = 3000
log_row_length = 300
def api_request_catch():
@ -17,12 +17,12 @@ def api_request_catch():
try:
res = func(*args, **kwargs)
log_res = str(res)[0:log_row_length] + '......' if len(str(res)) > log_row_length else str(res)
log.debug("(api_response) Response : %s " % log_res)
log.debug("(api_response) : %s " % log_res)
return res, True
except Exception as e:
log_e = str(e)[0:log_row_length] + '......' if len(str(e)) > log_row_length else str(e)
log.error(traceback.format_exc())
log.error("(api_response) [Milvus API Exception]%s: %s" % (str(func), log_e))
log.error("(api_response) : %s" % log_e)
return Error(e), False
return inner_wrapper
return wrapper
@ -38,7 +38,7 @@ def api_request(_list, **kwargs):
for a in _list[1:]:
arg.append(a)
log_arg = str(arg)[0:log_row_length] + '......' if len(str(arg)) > log_row_length else str(arg)
log.debug("(api_request) Request: [%s] args: %s, kwargs: %s" % (str(func), log_arg, str(kwargs)))
log.debug("(api_request) : [%s] args: %s, kwargs: %s" % (func.__qualname__, log_arg, str(kwargs)))
return func(*arg, **kwargs)
return False, False