[skip ci] use pymilvus-test, remove personal git repo (#3194)

* [skip ci] use pymilvus-test, remove personal git repo

Signed-off-by: zw <zw@milvus.io>

* [skip ci] add pytest dry-run

Signed-off-by: zw <zw@milvus.io>

Co-authored-by: zw <zw@milvus.io>
Co-authored-by: Jin Hai <hai.jin@zilliz.com>
pull/3196/head^2
del-zhenwu 2020-08-10 17:53:24 +08:00 committed by GitHub
parent a8c42736b1
commit c4cb6f4bbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 3 deletions

View File

@ -22,9 +22,7 @@ timeout(time: 120, unit: 'MINUTES') {
}
}
dir ("tests/milvus_python_test") {
// sh 'python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com'
sh 'python3 -m pip install -r requirements_no_pymilvus.txt'
sh 'python3 -m pip install git+https://github.com/BossZou/pymilvus.git@api-update'
sh 'python3 -m pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com'
sh "pytest . --alluredir=\"test_out/dev/single/mysql\" --level=1 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --service ${env.HELM_RELEASE_NAME} >> ${WORKSPACE}/${env.DEV_TEST_ARTIFACTS}/milvus_${BINARY_VERSION}_mysql_dev_test.log"
// sh "pytest test_restart.py --alluredir=\"test_out/dev/single/mysql\" --level=3 --ip ${env.HELM_RELEASE_NAME}.milvus.svc.cluster.local --service ${env.HELM_RELEASE_NAME}"
}

View File

@ -12,6 +12,15 @@ or test connect function only
pytest test_connect.py --level=1
```
collect cases
```shell
pytest --day-run -qq
```
collect cases with docstring
```shell
pytest --collect-only -qq
```
with allure test report
```shell

View File

@ -18,6 +18,7 @@ def pytest_addoption(parser):
parser.addoption("--http-port", action="store", default=19121)
parser.addoption("--handler", action="store", default="GRPC")
parser.addoption("--tag", action="store", default="all", help="only run tests matching the tag.")
parser.addoption('--dry-run', action='store_true', default=False)
def pytest_configure(config):
@ -38,6 +39,13 @@ def pytest_runtest_setup(item):
pytest.skip("test requires tag in {!r}".format(tags))
def pytest_runtestloop(session):
if session.config.getoption('--dry-run'):
for item in session.items:
print(item.nodeid)
return True
def check_server_connection(request):
ip = request.config.getoption("--ip")
port = request.config.getoption("--port")
@ -132,6 +140,7 @@ def collection(request, connect):
return collection_name
# customised id
@pytest.fixture(scope="function")
def id_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")
@ -168,6 +177,7 @@ def binary_collection(request, connect):
return collection_name
# customised id
@pytest.fixture(scope="function")
def binary_id_collection(request, connect):
ori_collection_name = getattr(request.module, "collection_id", "test")

View File

@ -9,3 +9,4 @@ pytest-level==0.1.1
pytest-xdist==1.23.2
scikit-learn>=0.19.1
kubernetes==10.0.1
pymilvus-test>=0.4.5