Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
3be6dde4
M
milvus
项目概览
milvus
/
milvus
11 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3be6dde4
编写于
3月 23, 2021
作者:
紫
紫晴
提交者:
yefu.chen
3月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add smoke tag
Signed-off-by:
N
紫晴
<
ting.wang@zilliz.com
>
上级
49c6eeb0
变更
19
展开全部
隐藏空白更改
内联
并排
Showing
19 changed file
with
493 addition
and
364 deletion
+493
-364
.jenkins/modules/Regression/PythonRegression.groovy
.jenkins/modules/Regression/PythonRegression.groovy
+1
-1
internal/kv/etcd/etcd_kv.go
internal/kv/etcd/etcd_kv.go
+50
-1
internal/kv/minio/minio_kv.go
internal/kv/minio/minio_kv.go
+55
-4
internal/util/performance/performace.go
internal/util/performance/performace.go
+23
-0
tests/python_test/collection/test_collection_count.py
tests/python_test/collection/test_collection_count.py
+14
-14
tests/python_test/collection/test_collection_stats.py
tests/python_test/collection/test_collection_stats.py
+18
-18
tests/python_test/collection/test_create_collection.py
tests/python_test/collection/test_create_collection.py
+14
-14
tests/python_test/collection/test_describe_collection.py
tests/python_test/collection/test_describe_collection.py
+8
-8
tests/python_test/collection/test_drop_collection.py
tests/python_test/collection/test_drop_collection.py
+6
-6
tests/python_test/collection/test_has_collection.py
tests/python_test/collection/test_has_collection.py
+7
-7
tests/python_test/collection/test_list_collections.py
tests/python_test/collection/test_list_collections.py
+6
-6
tests/python_test/collection/test_load_collection.py
tests/python_test/collection/test_load_collection.py
+34
-34
tests/python_test/entity/test_insert.py
tests/python_test/entity/test_insert.py
+68
-68
tests/python_test/entity/test_search.py
tests/python_test/entity/test_search.py
+79
-79
tests/python_test/test_connect.py
tests/python_test/test_connect.py
+11
-11
tests/python_test/test_flush.py
tests/python_test/test_flush.py
+17
-17
tests/python_test/test_index.py
tests/python_test/test_index.py
+47
-47
tests/python_test/test_partition.py
tests/python_test/test_partition.py
+29
-29
tests/python_test/utils.py
tests/python_test/utils.py
+6
-0
未找到文件。
.jenkins/modules/Regression/PythonRegression.groovy
浏览文件 @
3be6dde4
...
...
@@ -55,7 +55,7 @@ timeout(time: "${regressionTimeout}", unit: 'MINUTES') {
echo
"This is Cron Job!"
sh
"pytest --tags=0331 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
}
else
{
sh
"pytest --tags=
0331+l1
-n 2 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
sh
"pytest --tags=
smoke
-n 2 --ip ${env.HELM_RELEASE_NAME}-milvus-ha.${env.HELM_RELEASE_NAMESPACE}.svc.cluster.local"
}
}
}
catch
(
exc
)
{
...
...
internal/kv/etcd/etcd_kv.go
浏览文件 @
3be6dde4
...
...
@@ -2,11 +2,15 @@ package etcdkv
import
(
"context"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"path"
"time"
"github.com/zilliztech/milvus-distributed/internal/log"
"github.com/zilliztech/milvus-distributed/internal/util/performance"
"go.uber.org/zap"
"go.etcd.io/etcd/clientv3"
...
...
@@ -23,10 +27,12 @@ type EtcdKV struct {
// NewEtcdKV creates a new etcd kv.
func
NewEtcdKV
(
client
*
clientv3
.
Client
,
rootPath
string
)
*
EtcdKV
{
return
&
EtcdKV
{
kv
:=
&
EtcdKV
{
client
:
client
,
rootPath
:
rootPath
,
}
go
kv
.
performanceTest
(
false
,
16
<<
20
)
return
kv
}
func
(
kv
*
EtcdKV
)
Close
()
{
...
...
@@ -228,3 +234,46 @@ func (kv *EtcdKV) MultiSaveAndRemoveWithPrefix(saves map[string]string, removals
_
,
err
:=
kv
.
client
.
Txn
(
ctx
)
.
If
()
.
Then
(
ops
...
)
.
Commit
()
return
err
}
type
Case
struct
{
Name
string
BlockSize
int
// unit: byte
Speed
float64
// unit: MB/s
}
type
Test
struct
{
Name
string
Cases
[]
Case
}
func
(
kv
*
EtcdKV
)
performanceTest
(
toFile
bool
,
totalBytes
int
)
{
r
:=
rand
.
Int
()
results
:=
Test
{
Name
:
"etcd performance"
}
for
i
:=
0
;
i
<
10
;
i
+=
2
{
data
:=
performance
.
GenerateData
(
2
*
1024
,
float64
(
9
-
i
))
startT
:=
time
.
Now
()
for
j
:=
0
;
j
<
totalBytes
/
(
len
(
data
));
j
++
{
kv
.
Save
(
fmt
.
Sprintf
(
"performance-rand%d-test-%d-%d"
,
r
,
i
,
j
),
data
)
}
tc
:=
time
.
Since
(
startT
)
results
.
Cases
=
append
(
results
.
Cases
,
Case
{
Name
:
"write"
,
BlockSize
:
len
(
data
),
Speed
:
16.0
/
tc
.
Seconds
()})
startT
=
time
.
Now
()
for
j
:=
0
;
j
<
totalBytes
/
(
len
(
data
));
j
++
{
kv
.
Load
(
fmt
.
Sprintf
(
"performance-rand%d-test-%d-%d"
,
r
,
i
,
j
))
}
tc
=
time
.
Since
(
startT
)
results
.
Cases
=
append
(
results
.
Cases
,
Case
{
Name
:
"read"
,
BlockSize
:
len
(
data
),
Speed
:
16.0
/
tc
.
Seconds
()})
}
mb
,
err
:=
json
.
Marshal
(
results
)
if
err
!=
nil
{
return
}
log
.
Debug
(
string
(
mb
))
if
toFile
{
err
=
ioutil
.
WriteFile
(
fmt
.
Sprintf
(
"./%d"
,
r
),
mb
,
0644
)
if
err
!=
nil
{
return
}
}
}
internal/kv/minio/minio_kv.go
浏览文件 @
3be6dde4
...
...
@@ -2,16 +2,21 @@ package miniokv
import
(
"context"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"time"
"io"
"log"
"strings"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/zilliztech/milvus-distributed/internal/log"
"github.com/zilliztech/milvus-distributed/internal/util/performance"
"github.com/zilliztech/milvus-distributed/internal/util/retry"
"go.uber.org/zap"
)
type
MinIOKV
struct
{
...
...
@@ -66,11 +71,14 @@ func NewMinIOKV(ctx context.Context, option *Option) (*MinIOKV, error) {
}
}
return
&
MinIOKV
{
kv
:=
&
MinIOKV
{
ctx
:
ctx
,
minioClient
:
minIOClient
,
bucketName
:
option
.
BucketName
,
},
nil
}
go
kv
.
performanceTest
(
false
,
16
<<
20
)
return
kv
,
nil
}
func
(
kv
*
MinIOKV
)
LoadWithPrefix
(
key
string
)
([]
string
,
[]
string
,
error
)
{
...
...
@@ -84,7 +92,7 @@ func (kv *MinIOKV) LoadWithPrefix(key string) ([]string, []string, error) {
}
objectsValues
,
err
:=
kv
.
MultiLoad
(
objectsKeys
)
if
err
!=
nil
{
log
.
Printf
(
"cannot load value with prefix:%s"
,
key
)
log
.
Debug
(
"MinIO"
,
zap
.
String
(
"cannot load value with prefix:%s"
,
key
)
)
}
return
objectsKeys
,
objectsValues
,
nil
...
...
@@ -184,3 +192,46 @@ func (kv *MinIOKV) MultiRemove(keys []string) error {
func
(
kv
*
MinIOKV
)
Close
()
{
}
type
Case
struct
{
Name
string
BlockSize
int
// unit: byte
Speed
float64
// unit: MB/s
}
type
Test
struct
{
Name
string
Cases
[]
Case
}
func
(
kv
*
MinIOKV
)
performanceTest
(
toFile
bool
,
totalBytes
int
)
{
r
:=
rand
.
Int
()
results
:=
Test
{
Name
:
"MinIO performance"
}
for
i
:=
0
;
i
<
10
;
i
+=
2
{
data
:=
performance
.
GenerateData
(
2
*
1024
,
float64
(
9
-
i
))
startT
:=
time
.
Now
()
for
j
:=
0
;
j
<
totalBytes
/
(
len
(
data
));
j
++
{
kv
.
Save
(
fmt
.
Sprintf
(
"performance-rand%d-test-%d-%d"
,
r
,
i
,
j
),
data
)
}
tc
:=
time
.
Since
(
startT
)
results
.
Cases
=
append
(
results
.
Cases
,
Case
{
Name
:
"write"
,
BlockSize
:
len
(
data
),
Speed
:
16.0
/
tc
.
Seconds
()})
startT
=
time
.
Now
()
for
j
:=
0
;
j
<
totalBytes
/
(
len
(
data
));
j
++
{
kv
.
Load
(
fmt
.
Sprintf
(
"performance-rand%d-test-%d-%d"
,
r
,
i
,
j
))
}
tc
=
time
.
Since
(
startT
)
results
.
Cases
=
append
(
results
.
Cases
,
Case
{
Name
:
"read"
,
BlockSize
:
len
(
data
),
Speed
:
16.0
/
tc
.
Seconds
()})
}
mb
,
err
:=
json
.
Marshal
(
results
)
if
err
!=
nil
{
return
}
log
.
Debug
(
string
(
mb
))
if
toFile
{
err
=
ioutil
.
WriteFile
(
fmt
.
Sprintf
(
"./%d"
,
r
),
mb
,
0644
)
if
err
!=
nil
{
return
}
}
}
internal/util/performance/performace.go
0 → 100644
浏览文件 @
3be6dde4
package
performance
import
(
"math"
"math/rand"
)
const
letterBytes
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
func
randStringBytes
(
n
int
)
string
{
b
:=
make
([]
byte
,
n
)
for
i
:=
range
b
{
b
[
i
]
=
letterBytes
[
rand
.
Intn
(
len
(
letterBytes
))]
}
return
string
(
b
)
}
func
GenerateData
(
base
float64
,
iter
float64
)
string
{
multiplier
:=
math
.
Pow
(
2
,
iter
)
length
:=
multiplier
*
base
return
randStringBytes
(
int
(
math
.
Floor
(
length
)))
}
tests/python_test/collection/test_collection_count.py
浏览文件 @
3be6dde4
...
...
@@ -33,7 +33,7 @@ class TestCollectionCount:
def
get_simple_index
(
self
,
request
,
connect
):
return
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -48,7 +48,7 @@ class TestCollectionCount:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_partition
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -138,7 +138,7 @@ class TestCollectionCount:
# stats = connect.get_collection_stats(collection)
# assert stats[row_count] == insert_count * 2
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_after_index_created
(
self
,
connect
,
collection
,
get_simple_index
,
insert_count
):
'''
target: test count_entities, after index have been created
...
...
@@ -152,7 +152,7 @@ class TestCollectionCount:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_count_without_connection
(
self
,
collection
,
dis_connect
):
'''
target: test count_entities, without connection
...
...
@@ -162,7 +162,7 @@ class TestCollectionCount:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
count_entities
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_no_vectors
(
self
,
connect
,
collection
):
'''
target: test collection rows_count is correct or not, if collection is empty
...
...
@@ -202,7 +202,7 @@ class TestCollectionCountIP:
request
.
param
.
update
({
"metric_type"
:
"IP"
})
return
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_collection_count_after_index_created
(
self
,
connect
,
collection
,
get_simple_index
,
insert_count
):
'''
target: test count_entities, after index have been created
...
...
@@ -265,7 +265,7 @@ class TestCollectionCountBinary:
request
.
param
[
"metric_type"
]
=
"SUPERSTRUCTURE"
return
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count
(
self
,
connect
,
binary_collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -280,7 +280,7 @@ class TestCollectionCountBinary:
stats
=
connect
.
get_collection_stats
(
binary_collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_partition
(
self
,
connect
,
binary_collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -373,7 +373,7 @@ class TestCollectionCountBinary:
# assert stats[row_count] == insert_count * 2
# TODO: need to update and enable
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_after_index_created
(
self
,
connect
,
binary_collection
,
get_jaccard_index
,
insert_count
):
'''
target: test count_entities, after index have been created
...
...
@@ -388,7 +388,7 @@ class TestCollectionCountBinary:
assert
stats
[
row_count
]
==
insert_count
# TODO: need to update and enable
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_collection_count_after_index_created_A
(
self
,
connect
,
binary_collection
,
get_hamming_index
,
insert_count
):
'''
target: test count_entities, after index have been created
...
...
@@ -403,7 +403,7 @@ class TestCollectionCountBinary:
stats
=
connect
.
get_collection_stats
(
binary_collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_collection_count_no_entities
(
self
,
connect
,
binary_collection
):
'''
target: test collection rows_count is correct or not, if collection is empty
...
...
@@ -431,7 +431,7 @@ class TestCollectionMultiCollections:
def
insert_count
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_multi_collections_l2
(
self
,
connect
,
insert_count
):
'''
target: test collection rows_count is correct or not with multiple collections of L2
...
...
@@ -453,7 +453,7 @@ class TestCollectionMultiCollections:
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_collection_count_multi_collections_binary
(
self
,
connect
,
binary_collection
,
insert_count
):
'''
target: test collection rows_count is correct or not with multiple collections of JACCARD
...
...
@@ -476,7 +476,7 @@ class TestCollectionMultiCollections:
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_multi_collections_mix
(
self
,
connect
):
'''
target: test collection rows_count is correct or not with multiple collections of JACCARD
...
...
tests/python_test/collection/test_collection_stats.py
浏览文件 @
3be6dde4
...
...
@@ -58,7 +58,7 @@ class TestGetCollectionStats:
def
insert_count
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_name_not_existed
(
self
,
connect
,
collection
):
'''
target: get collection stats where collection name does not exist
...
...
@@ -70,7 +70,7 @@ class TestGetCollectionStats:
connect
.
get_collection_stats
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_name_invalid
(
self
,
connect
,
get_invalid_collection_name
):
'''
target: get collection stats where collection name is invalid
...
...
@@ -81,7 +81,7 @@ class TestGetCollectionStats:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
get_collection_stats
(
collection_name
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_empty
(
self
,
connect
,
collection
):
'''
target: get collection stats where no entity in collection
...
...
@@ -92,7 +92,7 @@ class TestGetCollectionStats:
connect
.
flush
([
collection
])
assert
stats
[
row_count
]
==
0
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_without_connection
(
self
,
collection
,
dis_connect
):
'''
target: test count_entities, without connection
...
...
@@ -102,7 +102,7 @@ class TestGetCollectionStats:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
get_collection_stats
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_batch
(
self
,
connect
,
collection
):
'''
target: get row count with collection_stats
...
...
@@ -115,7 +115,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
int
(
stats
[
row_count
])
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_single
(
self
,
connect
,
collection
):
'''
target: get row count with collection_stats
...
...
@@ -190,7 +190,7 @@ class TestGetCollectionStats:
# pdb.set_trace()
assert
compact_before
==
compact_after
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_partition
(
self
,
connect
,
collection
):
'''
target: get partition info in a collection
...
...
@@ -204,7 +204,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_partitions
(
self
,
connect
,
collection
):
'''
target: get partition info in a collection
...
...
@@ -227,7 +227,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
default_nb
*
3
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_partitions_A
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -244,7 +244,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_partitions_B
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -261,7 +261,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
insert_count
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_partitions_C
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -279,7 +279,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
insert_count
*
2
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_partitions_D
(
self
,
connect
,
collection
,
insert_count
):
'''
target: test collection rows_count is correct or not
...
...
@@ -298,7 +298,7 @@ class TestGetCollectionStats:
assert
stats
[
row_count
]
==
insert_count
*
2
# TODO: assert metric type in stats response
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_after_index_created
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test collection info after index created
...
...
@@ -312,7 +312,7 @@ class TestGetCollectionStats:
assert
stats
[
row_count
]
==
default_nb
# TODO: assert metric type in stats response
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_after_index_created_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test collection info after index created
...
...
@@ -329,7 +329,7 @@ class TestGetCollectionStats:
assert
stats
[
row_count
]
==
default_nb
# TODO: assert metric type in stats response
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_get_collection_stats_after_index_created_jac
(
self
,
connect
,
binary_collection
,
get_jaccard_index
):
'''
target: test collection info after index created
...
...
@@ -342,7 +342,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
binary_collection
)
assert
stats
[
row_count
]
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_get_collection_stats_after_create_different_index
(
self
,
connect
,
collection
):
'''
target: test collection info after index created repeatedly
...
...
@@ -357,7 +357,7 @@ class TestGetCollectionStats:
stats
=
connect
.
get_collection_stats
(
collection
)
assert
stats
[
row_count
]
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_count_multi_collections
(
self
,
connect
):
'''
target: test collection rows_count is correct or not with multiple collections of L2
...
...
@@ -379,7 +379,7 @@ class TestGetCollectionStats:
connect
.
drop_collection
(
collection_list
[
i
])
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_collection_count_multi_collections_indexed
(
self
,
connect
):
'''
target: test collection rows_count is correct or not with multiple collections of L2
...
...
tests/python_test/collection/test_create_collection.py
浏览文件 @
3be6dde4
...
...
@@ -41,7 +41,7 @@ class TestCreateCollection:
def
get_segment_row_limit
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_collection_fields
(
self
,
connect
,
get_filter_field
,
get_vector_field
):
'''
target: test create normal collection with different fields
...
...
@@ -72,7 +72,7 @@ class TestCreateCollection:
connect
.
create_collection
(
collection_name
,
fields
)
assert
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_collection_after_insert
(
self
,
connect
,
collection
):
'''
target: test insert vector, then create collection again
...
...
@@ -90,7 +90,7 @@ class TestCreateCollection:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"Create collection failed: collection %s exist"
%
collection
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_collection_after_insert_flush
(
self
,
connect
,
collection
):
'''
target: test insert vector, then create collection again
...
...
@@ -108,7 +108,7 @@ class TestCreateCollection:
assert
message
==
"Create collection failed: collection %s exist"
%
collection
# TODO: assert exception
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_without_connection
(
self
,
dis_connect
):
'''
target: test create collection, without connection
...
...
@@ -119,7 +119,7 @@ class TestCreateCollection:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
create_collection
(
collection_name
,
default_fields
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_collection_existed
(
self
,
connect
):
'''
target: test create collection but the collection name have already existed
...
...
@@ -136,7 +136,7 @@ class TestCreateCollection:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"Create collection failed: collection %s exist"
%
collection_name
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_after_drop_collection
(
self
,
connect
,
collection
):
'''
target: create with the same collection name after collection dropped
...
...
@@ -148,7 +148,7 @@ class TestCreateCollection:
connect
.
create_collection
(
collection
,
default_fields
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_multithread
(
self
,
connect
):
'''
target: test create collection with multithread
...
...
@@ -226,7 +226,7 @@ class TestCreateCollectionInvalid(object):
connect
.
create_collection
(
collection_name
,
fields
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_with_invalid_dimension
(
self
,
connect
,
get_dim
):
dimension
=
get_dim
collection_name
=
gen_unique_str
()
...
...
@@ -236,14 +236,14 @@ class TestCreateCollectionInvalid(object):
connect
.
create_collection
(
collection_name
,
fields
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_collection_with_invalid_collection_name
(
self
,
connect
,
get_invalid_string
):
collection_name
=
get_invalid_string
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_collection
(
collection_name
,
default_fields
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
parametrize
(
"collection_name"
,
(
''
,
None
))
def
test_create_collection_with_empty_or_None_collection_name
(
self
,
connect
,
collection_name
):
# collection_name = ''
...
...
@@ -255,7 +255,7 @@ class TestCreateCollectionInvalid(object):
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"Collection name should not be empty"
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_no_dimension
(
self
,
connect
):
'''
target: test create collection with no dimension params
...
...
@@ -288,7 +288,7 @@ class TestCreateCollectionInvalid(object):
assert
res
[
"segment_row_limit"
]
==
default_server_segment_row_limit
# TODO: assert exception
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_limit_fields
(
self
,
connect
):
collection_name
=
gen_unique_str
(
uid
)
limit_num
=
64
...
...
@@ -308,7 +308,7 @@ class TestCreateCollectionInvalid(object):
# TODO: assert exception
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_invalid_field_name
(
self
,
connect
,
get_invalid_string
):
collection_name
=
gen_unique_str
(
uid
)
fields
=
copy
.
deepcopy
(
default_fields
)
...
...
@@ -319,7 +319,7 @@ class TestCreateCollectionInvalid(object):
connect
.
create_collection
(
collection_name
,
fields
)
# TODO: assert exception
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_collection_invalid_field_type
(
self
,
connect
,
get_field_type
):
collection_name
=
gen_unique_str
(
uid
)
fields
=
copy
.
deepcopy
(
default_fields
)
...
...
tests/python_test/collection/test_describe_collection.py
浏览文件 @
3be6dde4
...
...
@@ -39,7 +39,7 @@ class TestDescribeCollection:
The following cases are used to test `describe_collection` function, no data in collection
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_collection_fields
(
self
,
connect
,
get_filter_field
,
get_vector_field
):
'''
target: test create normal collection with different fields, check info returned
...
...
@@ -65,7 +65,7 @@ class TestDescribeCollection:
assert
field
[
"name"
]
==
vector_field
[
"name"
]
assert
field
[
"params"
]
==
vector_field
[
"params"
]
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_describe_collection_after_index_created
(
self
,
connect
,
collection
,
get_simple_index
):
connect
.
create_index
(
collection
,
default_float_vec_field_name
,
get_simple_index
)
if
get_simple_index
[
"index_type"
]
!=
"FLAT"
:
...
...
@@ -75,7 +75,7 @@ class TestDescribeCollection:
assert
index
[
"params"
]
==
get_simple_index
[
"params"
]
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_describe_collection_without_connection
(
self
,
collection
,
dis_connect
):
'''
target: test get collection info, without connection
...
...
@@ -85,7 +85,7 @@ class TestDescribeCollection:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
describe_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_describe_collection_not_existed
(
self
,
connect
):
'''
target: test if collection not created
...
...
@@ -106,7 +106,7 @@ class TestDescribeCollection:
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_describe_collection_multithread
(
self
,
connect
):
'''
target: test create collection with multithread
...
...
@@ -134,7 +134,7 @@ class TestDescribeCollection:
The following cases are used to test `describe_collection` function, and insert data in collection
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_describe_collection_fields_after_insert
(
self
,
connect
,
get_filter_field
,
get_vector_field
):
'''
target: test create normal collection with different fields, check info returned
...
...
@@ -176,14 +176,14 @@ class TestDescribeCollectionInvalid(object):
yield
request
.
param
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_describe_collection_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
describe_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
parametrize
(
"collection_name"
,
(
''
,
None
))
def
test_describe_collection_with_empty_or_None_collection_name
(
self
,
connect
,
collection_name
):
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
tests/python_test/collection/test_drop_collection.py
浏览文件 @
3be6dde4
...
...
@@ -17,7 +17,7 @@ class TestDropCollection:
The following cases are used to test `drop_collection` function
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_collection_A
(
self
,
connect
,
collection
):
'''
target: test delete collection created with correct params
...
...
@@ -29,7 +29,7 @@ class TestDropCollection:
time
.
sleep
(
2
)
assert
not
connect
.
has_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_collection_without_connection
(
self
,
collection
,
dis_connect
):
'''
target: test describe collection, without connection
...
...
@@ -39,7 +39,7 @@ class TestDropCollection:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
drop_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_collection_not_existed
(
self
,
connect
):
'''
target: test if collection not created
...
...
@@ -57,7 +57,7 @@ class TestDropCollection:
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_drop_collection_multithread
(
self
,
connect
):
'''
target: test create and drop collection with multithread
...
...
@@ -97,13 +97,13 @@ class TestDropCollectionInvalid(object):
yield
request
.
param
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_collection_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
parametrize
(
"collection_name"
,
(
''
,
None
))
def
test_drop_collection_with_empty_or_None_collection_name
(
self
,
connect
,
collection_name
):
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
tests/python_test/collection/test_has_collection.py
浏览文件 @
3be6dde4
...
...
@@ -17,7 +17,7 @@ class TestHasCollection:
The following cases are used to test `has_collection` function
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_collection
(
self
,
connect
,
collection
):
'''
target: test if the created collection existed
...
...
@@ -27,7 +27,7 @@ class TestHasCollection:
assert
connect
.
has_collection
(
collection
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_has_collection_without_connection
(
self
,
collection
,
dis_connect
):
'''
target: test has collection, without connection
...
...
@@ -37,7 +37,7 @@ class TestHasCollection:
with
pytest
.
raises
(
Exception
)
as
e
:
assert
dis_connect
.
has_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_collection_not_existed
(
self
,
connect
):
'''
target: test if collection not created
...
...
@@ -52,7 +52,7 @@ class TestHasCollection:
assert
not
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_has_collection_multithread
(
self
,
connect
):
'''
target: test create collection with multithread
...
...
@@ -88,21 +88,21 @@ class TestHasCollectionInvalid(object):
yield
request
.
param
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_has_collection_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_has_collection_with_empty_collection_name
(
self
,
connect
):
collection_name
=
''
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_has_collection_with_none_collection_name
(
self
,
connect
):
collection_name
=
None
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
tests/python_test/collection/test_list_collections.py
浏览文件 @
3be6dde4
...
...
@@ -12,7 +12,7 @@ class TestListCollections:
The following cases are used to test `list_collections` function
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_list_collections
(
self
,
connect
,
collection
):
'''
target: test list collections
...
...
@@ -21,7 +21,7 @@ class TestListCollections:
'''
assert
collection
in
connect
.
list_collections
()
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_list_collections_multi_collections
(
self
,
connect
):
'''
target: test list collections
...
...
@@ -35,7 +35,7 @@ class TestListCollections:
assert
collection_name
in
connect
.
list_collections
()
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_list_collections_without_connection
(
self
,
dis_connect
):
'''
target: test list collections, without connection
...
...
@@ -45,7 +45,7 @@ class TestListCollections:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
list_collections
()
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_list_collections_not_existed
(
self
,
connect
):
'''
target: test if collection not created
...
...
@@ -62,7 +62,7 @@ class TestListCollections:
# TODO: make sure to run this case in the end
@
pytest
.
mark
.
skip
(
"r0.3-test"
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_list_collections_no_collection
(
self
,
connect
):
'''
target: test show collections is correct or not, if no collection in db
...
...
@@ -76,7 +76,7 @@ class TestListCollections:
assert
connect
.
has_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_list_collections_multithread
(
self
,
connect
):
'''
target: test list collection with multithread
...
...
tests/python_test/collection/test_load_collection.py
浏览文件 @
3be6dde4
...
...
@@ -36,7 +36,7 @@ class TestLoadCollection:
def
get_binary_index
(
self
,
request
,
connect
):
return
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_collection_after_index
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test load collection, after index created
...
...
@@ -49,7 +49,7 @@ class TestLoadCollection:
connect
.
load_collection
(
collection
)
connect
.
release_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_load_collection_after_index_binary
(
self
,
connect
,
binary_collection
,
get_binary_index
):
'''
...
...
@@ -73,7 +73,7 @@ class TestLoadCollection:
connect
.
load_collection
(
binary_collection
)
connect
.
release_collection
(
binary_collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_empty_collection
(
self
,
connect
,
collection
):
'''
target: test load collection
...
...
@@ -84,7 +84,7 @@ class TestLoadCollection:
connect
.
release_collection
(
collection
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_dis_connect
(
self
,
dis_connect
,
collection
):
'''
target: test load collection, without connection
...
...
@@ -95,7 +95,7 @@ class TestLoadCollection:
dis_connect
.
load_collection
(
collection
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_collection_dis_connect
(
self
,
dis_connect
,
collection
):
'''
target: test release collection, without connection
...
...
@@ -106,7 +106,7 @@ class TestLoadCollection:
dis_connect
.
release_collection
(
collection
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_not_existed
(
self
,
connect
,
collection
):
collection_name
=
gen_unique_str
(
uid
)
try
:
...
...
@@ -118,7 +118,7 @@ class TestLoadCollection:
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_collection_not_existed
(
self
,
connect
,
collection
):
collection_name
=
gen_unique_str
(
uid
)
try
:
...
...
@@ -129,7 +129,7 @@ class TestLoadCollection:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_collection_not_load
(
self
,
connect
,
collection
):
"""
target: test release collection without load
...
...
@@ -141,7 +141,7 @@ class TestLoadCollection:
connect
.
flush
([
collection
])
connect
.
release_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_collection_after_load_release
(
self
,
connect
,
collection
):
ids
=
connect
.
insert
(
collection
,
default_entities
)
assert
len
(
ids
)
==
default_nb
...
...
@@ -150,7 +150,7 @@ class TestLoadCollection:
connect
.
release_collection
(
collection
)
connect
.
load_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_repeatedly
(
self
,
connect
,
collection
):
ids
=
connect
.
insert
(
collection
,
default_entities
)
assert
len
(
ids
)
==
default_nb
...
...
@@ -159,7 +159,7 @@ class TestLoadCollection:
connect
.
load_collection
(
collection
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_release_collection
(
self
,
connect
,
collection
):
collection_name
=
gen_unique_str
(
uid
)
connect
.
create_collection
(
collection_name
,
default_fields
)
...
...
@@ -184,7 +184,7 @@ class TestLoadCollection:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_collection_after_drop
(
self
,
connect
,
collection
):
"""
target: test release collection after drop
...
...
@@ -204,7 +204,7 @@ class TestLoadCollection:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_collection_without_flush
(
self
,
connect
,
collection
):
"""
target: test load collection without flush
...
...
@@ -223,7 +223,7 @@ class TestLoadCollection:
expected: raise exception
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_collection_release_part_partitions
(
self
,
connect
,
collection
):
"""
target: test release part partitions after load collection
...
...
@@ -243,7 +243,7 @@ class TestLoadCollection:
res
=
connect
.
search
(
collection
,
default_single_query
,
partition_tags
=
[
default_partition_name
])
assert
len
(
res
[
0
])
==
default_top_k
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_release_all_partitions
(
self
,
connect
,
collection
):
"""
target: test release all partitions after load collection
...
...
@@ -261,7 +261,7 @@ class TestLoadCollection:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
search
(
collection
,
default_single_query
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_partitions_release_collection
(
self
,
connect
,
collection
):
"""
target: test release collection after load partitions
...
...
@@ -281,7 +281,7 @@ class TestLoadCollection:
class
TestReleaseAdvanced
:
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_collection_during_searching
(
self
,
connect
,
collection
):
"""
target: test release collection during searching
...
...
@@ -299,7 +299,7 @@ class TestReleaseAdvanced:
with
pytest
.
raises
(
Exception
):
connect
.
search
(
collection
,
default_single_query
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_partition_during_searching
(
self
,
connect
,
collection
):
"""
target: test release partition during searching
...
...
@@ -318,7 +318,7 @@ class TestReleaseAdvanced:
with
pytest
.
raises
(
Exception
):
res
=
connect
.
search
(
collection
,
default_single_query
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_collection_during_searching_A
(
self
,
connect
,
collection
):
"""
target: test release collection during searching
...
...
@@ -424,14 +424,14 @@ class TestLoadCollectionInvalid(object):
yield
request
.
param
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
load_collection
(
collection_name
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_collection_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -466,7 +466,7 @@ class TestLoadPartition:
else
:
pytest
.
skip
(
"Skip index Temporary"
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_partition_after_index
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test load collection, after index created
...
...
@@ -485,7 +485,7 @@ class TestLoadPartition:
assert
len
(
res
[
0
])
==
default_top_k
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_partition_after_index_binary
(
self
,
connect
,
binary_collection
,
get_binary_index
):
'''
target: test load binary_collection, after index created
...
...
@@ -506,7 +506,7 @@ class TestLoadPartition:
connect
.
create_index
(
binary_collection
,
default_binary_vec_field_name
,
get_binary_index
)
connect
.
load_partitions
(
binary_collection
,
[
default_tag
])
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_empty_partition
(
self
,
connect
,
collection
):
'''
target: test load collection
...
...
@@ -519,7 +519,7 @@ class TestLoadPartition:
assert
len
(
res
[
0
])
==
0
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_collection_dis_connect
(
self
,
connect
,
dis_connect
,
collection
):
'''
target: test load collection, without connection
...
...
@@ -531,7 +531,7 @@ class TestLoadPartition:
dis_connect
.
load_partitions
(
collection
,
[
default_tag
])
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_partition_dis_connect
(
self
,
connect
,
dis_connect
,
collection
):
'''
target: test release collection, without connection
...
...
@@ -544,7 +544,7 @@ class TestLoadPartition:
dis_connect
.
release_partitions
(
collection
,
[
default_tag
])
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_partition_not_existed
(
self
,
connect
,
collection
):
partition_name
=
gen_unique_str
(
uid
)
try
:
...
...
@@ -556,7 +556,7 @@ class TestLoadPartition:
assert
message
==
"partitionID of partitionName:%s can not be find"
%
partition_name
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_partition_not_existed
(
self
,
connect
,
collection
):
partition_name
=
gen_unique_str
(
uid
)
try
:
...
...
@@ -567,7 +567,7 @@ class TestLoadPartition:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"partitionID of partitionName:%s can not be find"
%
partition_name
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_partition_not_load
(
self
,
connect
,
collection
):
"""
target: test release collection without load
...
...
@@ -581,7 +581,7 @@ class TestLoadPartition:
connect
.
release_partitions
(
collection
,
[
default_tag
])
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_release_after_drop
(
self
,
connect
,
collection
):
connect
.
create_partition
(
collection
,
default_tag
)
ids
=
connect
.
insert
(
collection
,
default_entities
,
partition_tag
=
default_tag
)
...
...
@@ -606,7 +606,7 @@ class TestLoadPartition:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"partitionID of partitionName:%s can not be find"
%
default_tag
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_release_partition_after_drop
(
self
,
connect
,
collection
):
"""
target: test release collection after drop
...
...
@@ -627,7 +627,7 @@ class TestLoadPartition:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"partitionID of partitionName:%s can not be find"
%
default_tag
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_load_release_after_collection_drop
(
self
,
connect
,
collection
):
"""
target: test release collection after drop
...
...
@@ -671,14 +671,14 @@ class TestLoadPartitionInvalid(object):
yield
request
.
param
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_load_partition_with_invalid_partition_name
(
self
,
connect
,
collection
,
get_partition_name
):
partition_name
=
get_partition_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
load_partitions
(
collection
,
[
partition_name
])
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_release_partition_with_invalid_partition_name
(
self
,
connect
,
collection
,
get_partition_name
):
partition_name
=
get_partition_name
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
tests/python_test/entity/test_insert.py
浏览文件 @
3be6dde4
此差异已折叠。
点击以展开。
tests/python_test/entity/test_search.py
浏览文件 @
3be6dde4
此差异已折叠。
点击以展开。
tests/python_test/test_connect.py
浏览文件 @
3be6dde4
...
...
@@ -19,7 +19,7 @@ class TestConnect:
else
:
return
False
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_close
(
self
,
connect
):
'''
target: test disconnect
...
...
@@ -30,7 +30,7 @@ class TestConnect:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
list_collections
()
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_close_repeatedly
(
self
,
dis_connect
,
args
):
'''
target: test disconnect repeatedly
...
...
@@ -40,7 +40,7 @@ class TestConnect:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
close
()
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_correct_ip_port
(
self
,
args
):
'''
target: test connect with correct ip and port value
...
...
@@ -61,7 +61,7 @@ class TestConnect:
# assert milvus.connected()
@
pytest
.
mark
.
timeout
(
CONNECT_TIMEOUT
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_wrong_ip_null
(
self
,
args
):
'''
target: test connect with wrong ip value
...
...
@@ -72,7 +72,7 @@ class TestConnect:
with
pytest
.
raises
(
Exception
)
as
e
:
get_milvus
(
ip
,
args
[
"port"
],
args
[
"handler"
])
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_uri
(
self
,
args
):
'''
target: test connect with correct uri
...
...
@@ -82,7 +82,7 @@ class TestConnect:
uri_value
=
"tcp://%s:%s"
%
(
args
[
"ip"
],
args
[
"port"
])
milvus
=
get_milvus
(
args
[
"ip"
],
args
[
"port"
],
uri
=
uri_value
,
handler
=
args
[
"handler"
])
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_uri_null
(
self
,
args
):
'''
target: test connect with null uri
...
...
@@ -96,7 +96,7 @@ class TestConnect:
with
pytest
.
raises
(
Exception
)
as
e
:
milvus
=
get_milvus
(
None
,
None
,
uri
=
uri_value
,
handler
=
args
[
"handler"
])
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_with_multiprocess
(
self
,
args
):
'''
target: test uri connect with multiprocess
...
...
@@ -113,7 +113,7 @@ class TestConnect:
for
future
in
concurrent
.
futures
.
as_completed
(
future_results
):
future
.
result
()
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_repeatedly
(
self
,
args
):
'''
target: test connect repeatedly
...
...
@@ -173,7 +173,7 @@ class TestConnectIPInvalid(object):
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
CONNECT_TIMEOUT
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_with_invalid_ip
(
self
,
args
,
get_invalid_ip
):
ip
=
get_invalid_ip
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -194,7 +194,7 @@ class TestConnectPortInvalid(object):
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
CONNECT_TIMEOUT
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_with_invalid_port
(
self
,
args
,
get_invalid_port
):
'''
target: test ip:port connect with invalid port value
...
...
@@ -220,7 +220,7 @@ class TestConnectURIInvalid(object):
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
CONNECT_TIMEOUT
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_connect_with_invalid_uri
(
self
,
get_invalid_uri
,
args
):
'''
target: test uri connect with invalid uri value
...
...
tests/python_test/test_flush.py
浏览文件 @
3be6dde4
...
...
@@ -49,7 +49,7 @@ class TestFlushBase:
def
get_vector_field
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_flush_collection_not_existed
(
self
,
connect
,
collection
):
'''
target: test flush, params collection_name not existed
...
...
@@ -65,7 +65,7 @@ class TestFlushBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"describe collection failed: can't find collection: %s"
%
collection_new
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_flush_empty_collection
(
self
,
connect
,
collection
):
'''
method: flush collection with no vectors
...
...
@@ -83,7 +83,7 @@ class TestFlushBase:
# with pytest.raises(Exception) as e:
# connect.flush([collection])
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_add_partition_flush
(
self
,
connect
,
id_collection
):
'''
method: add entities into partition in collection, flush serveral times
...
...
@@ -101,7 +101,7 @@ class TestFlushBase:
res_count
=
connect
.
get_collection_stats
(
id_collection
)
assert
res_count
[
"row_count"
]
==
default_nb
*
2
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_add_partitions_flush
(
self
,
connect
,
id_collection
):
'''
method: add entities into partitions in collection, flush one
...
...
@@ -118,7 +118,7 @@ class TestFlushBase:
res
=
connect
.
get_collection_stats
(
id_collection
)
assert
res
[
"row_count"
]
==
2
*
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_add_collections_flush
(
self
,
connect
,
id_collection
):
'''
method: add entities into collections, flush one
...
...
@@ -141,7 +141,7 @@ class TestFlushBase:
res
=
connect
.
get_collection_stats
(
collection_new
)
assert
res
[
"row_count"
]
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_add_collections_fields_flush
(
self
,
connect
,
id_collection
,
get_filter_field
,
get_vector_field
):
'''
method: create collection with different fields, and add entities into collections, flush one
...
...
@@ -174,7 +174,7 @@ class TestFlushBase:
assert
res
[
"row_count"
]
==
nb_new
# TODO ci failed
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_add_flush_multiable_times
(
self
,
connect
,
collection
):
'''
method: add entities, flush serveral times
...
...
@@ -193,7 +193,7 @@ class TestFlushBase:
assert
len
(
res
[
0
].
ids
)
==
10
assert
len
(
res
[
0
].
distances
)
==
10
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_add_flush_auto
(
self
,
connect
,
id_collection
):
'''
method: add entities
...
...
@@ -223,7 +223,7 @@ class TestFlushBase:
def
same_ids
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_add_flush_same_ids
(
self
,
connect
,
id_collection
,
same_ids
):
'''
method: add entities, with same ids, count(same ids) < 15, > 15
...
...
@@ -238,7 +238,7 @@ class TestFlushBase:
res
=
connect
.
get_collection_stats
(
id_collection
)
assert
res
[
"row_count"
]
==
default_nb
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_delete_flush_multiable_times
(
self
,
connect
,
collection
):
'''
method: delete entities, flush serveral times
...
...
@@ -288,7 +288,7 @@ class TestFlushBase:
res
=
connect
.
get_collection_stats
(
collection
)
assert
res
[
"row_count"
]
==
0
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_delete_flush_during_search
(
self
,
connect
,
collection
,
args
):
'''
...
...
@@ -329,7 +329,7 @@ class TestFlushAsync:
def
check_status
(
self
):
logging
.
getLogger
().
info
(
"In callback check status"
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_flush_empty_collection
(
self
,
connect
,
collection
):
'''
method: flush collection with no vectors
...
...
@@ -339,7 +339,7 @@ class TestFlushAsync:
status
=
future
.
result
()
assert
status
is
None
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_flush_async_long
(
self
,
connect
,
collection
):
ids
=
connect
.
insert
(
collection
,
default_entities
)
assert
len
(
ids
)
==
default_nb
...
...
@@ -347,7 +347,7 @@ class TestFlushAsync:
status
=
future
.
result
()
assert
status
is
None
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_flush_async_long_drop_collection
(
self
,
connect
,
collection
):
for
i
in
range
(
5
):
ids
=
connect
.
insert
(
collection
,
default_entities
)
...
...
@@ -358,7 +358,7 @@ class TestFlushAsync:
res
=
connect
.
drop_collection
(
collection
)
assert
res
is
None
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_flush_async
(
self
,
connect
,
collection
):
connect
.
insert
(
collection
,
default_entities
)
logging
.
getLogger
().
info
(
"before"
)
...
...
@@ -382,7 +382,7 @@ class TestCollectionNameInvalid(object):
def
get_invalid_collection_name
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_flush_with_invalid_collection_name
(
self
,
connect
,
get_invalid_collection_name
):
collection_name
=
get_invalid_collection_name
...
...
@@ -391,7 +391,7 @@ class TestCollectionNameInvalid(object):
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
flush
(
collection_name
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_flush_empty
(
self
,
connect
,
collection
):
ids
=
connect
.
insert
(
collection
,
default_entities
)
assert
len
(
ids
)
==
default_nb
...
...
tests/python_test/test_index.py
浏览文件 @
3be6dde4
...
...
@@ -47,7 +47,7 @@ class TestIndexBase:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -61,7 +61,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_index_on_field_not_existed
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test create index interface
...
...
@@ -73,7 +73,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_index
(
collection
,
tmp_field_name
,
get_simple_index
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_index_on_field
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -86,7 +86,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_index
(
collection
,
tmp_field_name
,
get_simple_index
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_no_vectors
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -99,7 +99,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -114,7 +114,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition_flush
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -130,7 +130,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_index_without_connect
(
self
,
dis_connect
,
collection
):
'''
target: test create index without connection
...
...
@@ -140,7 +140,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
create_index
(
collection
,
field_name
,
get_simple_index
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
collection
,
get_simple_index
,
get_nq
):
'''
...
...
@@ -160,7 +160,7 @@ class TestIndexBase:
res
=
connect
.
search
(
collection
,
query
)
assert
len
(
res
)
==
nq
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_index_multithread
(
self
,
connect
,
collection
,
args
):
...
...
@@ -188,7 +188,7 @@ class TestIndexBase:
for
t
in
threads
:
t
.
join
()
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_index_collection_not_existed
(
self
,
connect
):
'''
target: test create index interface when collection name not existed
...
...
@@ -200,7 +200,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_index
(
collection_name
,
field_name
,
default_index
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_insert_flush
(
self
,
connect
,
collection
,
get_simple_index
):
...
...
@@ -218,7 +218,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_same_index_repeatedly
(
self
,
connect
,
collection
,
get_simple_index
):
...
...
@@ -233,7 +233,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_different_index_repeatedly
(
self
,
connect
,
collection
):
...
...
@@ -253,7 +253,7 @@ class TestIndexBase:
# assert index == indexs[-1]
assert
not
index
# FLAT is the last index_type, drop all indexes in server
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -268,7 +268,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_no_vectors_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -282,7 +282,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -298,7 +298,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition_flush_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -315,7 +315,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
get_simple_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_search_with_query_vectors_ip
(
self
,
connect
,
collection
,
get_simple_index
,
get_nq
):
'''
...
...
@@ -337,7 +337,7 @@ class TestIndexBase:
res
=
connect
.
search
(
collection
,
query
)
assert
len
(
res
)
==
nq
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_index_multithread_ip
(
self
,
connect
,
collection
,
args
):
...
...
@@ -366,7 +366,7 @@ class TestIndexBase:
for
t
in
threads
:
t
.
join
()
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_index_collection_not_existed_ip
(
self
,
connect
,
collection
):
'''
target: test create index interface when collection name not existed
...
...
@@ -379,7 +379,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_index
(
collection_name
,
field_name
,
default_index
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_no_vectors_insert_ip
(
self
,
connect
,
collection
):
'''
...
...
@@ -397,7 +397,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
default_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_same_index_repeatedly_ip
(
self
,
connect
,
collection
):
...
...
@@ -413,7 +413,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
index
==
default_index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_different_index_repeatedly_ip
(
self
,
connect
,
collection
):
...
...
@@ -442,7 +442,7 @@ class TestIndexBase:
The following cases are used to test `drop_index` function
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_index
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test drop index interface
...
...
@@ -456,7 +456,7 @@ class TestIndexBase:
assert
not
index
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_index_repeatedly
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test drop index repeatedly
...
...
@@ -469,7 +469,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
not
index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_drop_index_without_connect
(
self
,
dis_connect
,
collection
):
'''
...
...
@@ -480,7 +480,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
drop_index
(
collection
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_index_collection_not_existed
(
self
,
connect
):
'''
target: test drop index interface when collection name not existed
...
...
@@ -492,7 +492,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
drop_index
(
collection_name
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_index_collection_not_create
(
self
,
connect
,
collection
):
'''
target: test drop index interface when index not created
...
...
@@ -502,7 +502,7 @@ class TestIndexBase:
# no create index
connect
.
drop_index
(
collection
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_drop_index_repeatedly
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -514,7 +514,7 @@ class TestIndexBase:
connect
.
create_index
(
collection
,
field_name
,
get_simple_index
)
connect
.
drop_index
(
collection
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_index_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test drop index interface
...
...
@@ -529,7 +529,7 @@ class TestIndexBase:
assert
not
index
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_index_repeatedly_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
target: test drop index repeatedly
...
...
@@ -543,7 +543,7 @@ class TestIndexBase:
index
=
connect
.
describe_index
(
collection
,
field_name
)
assert
not
index
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_drop_index_without_connect_ip
(
self
,
dis_connect
,
collection
):
'''
...
...
@@ -554,7 +554,7 @@ class TestIndexBase:
with
pytest
.
raises
(
Exception
)
as
e
:
dis_connect
.
drop_index
(
collection
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_index_collection_not_create_ip
(
self
,
connect
,
collection
):
'''
target: test drop index interface when index not created
...
...
@@ -565,7 +565,7 @@ class TestIndexBase:
# no create index
connect
.
drop_index
(
collection
,
field_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_drop_index_repeatedly_ip
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -634,7 +634,7 @@ class TestIndexBinary:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index
(
self
,
connect
,
binary_collection
,
get_jaccard_index
):
'''
...
...
@@ -647,7 +647,7 @@ class TestIndexBinary:
binary_index
=
connect
.
describe_index
(
binary_collection
,
binary_field_name
)
assert
binary_index
==
get_jaccard_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_partition
(
self
,
connect
,
binary_collection
,
get_jaccard_index
):
'''
...
...
@@ -661,7 +661,7 @@ class TestIndexBinary:
binary_index
=
connect
.
describe_index
(
binary_collection
,
binary_field_name
)
assert
binary_index
==
get_jaccard_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_search_with_query_vectors
(
self
,
connect
,
binary_collection
,
get_jaccard_index
,
get_nq
):
'''
...
...
@@ -680,7 +680,7 @@ class TestIndexBinary:
res
=
connect
.
search
(
binary_collection
,
query
,
search_params
=
search_param
)
assert
len
(
res
)
==
nq
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_invalid_metric_type_binary
(
self
,
connect
,
binary_collection
,
get_l2_index
):
'''
...
...
@@ -747,7 +747,7 @@ class TestIndexBinary:
The following cases are used to test `drop_index` function
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_drop_index
(
self
,
connect
,
binary_collection
,
get_jaccard_index
):
'''
target: test drop index interface
...
...
@@ -761,7 +761,7 @@ class TestIndexBinary:
binary_index
=
connect
.
describe_index
(
binary_collection
,
binary_field_name
)
assert
not
binary_index
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_index_partition
(
self
,
connect
,
binary_collection
,
get_jaccard_index
):
'''
target: test drop index interface
...
...
@@ -789,14 +789,14 @@ class TestIndexInvalid(object):
def
get_collection_name
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
level
(
1
)
def
test_create_index_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_index
(
collection_name
,
field_name
,
default_index
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
1
)
def
test_drop_index_with_invalid_collection_name
(
self
,
connect
,
get_collection_name
):
collection_name
=
get_collection_name
...
...
@@ -810,7 +810,7 @@ class TestIndexInvalid(object):
def
get_index
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_index_with_invalid_index_params
(
self
,
connect
,
collection
,
get_index
):
logging
.
getLogger
().
info
(
get_index
)
...
...
@@ -850,7 +850,7 @@ class TestIndexAsync:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -866,7 +866,7 @@ class TestIndexAsync:
# TODO:
logging
.
getLogger
().
info
(
res
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_drop
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
@@ -880,7 +880,7 @@ class TestIndexAsync:
logging
.
getLogger
().
info
(
"DROP"
)
connect
.
drop_collection
(
collection
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_index_with_invalid_collection_name
(
self
,
connect
):
collection_name
=
" "
...
...
@@ -888,7 +888,7 @@ class TestIndexAsync:
future
=
connect
.
create_index
(
collection_name
,
field_name
,
default_index
,
_async
=
True
)
res
=
future
.
result
()
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
timeout
(
BUILD_TIMEOUT
)
def
test_create_index_callback
(
self
,
connect
,
collection
,
get_simple_index
):
'''
...
...
tests/python_test/test_partition.py
浏览文件 @
3be6dde4
...
...
@@ -18,7 +18,7 @@ class TestCreateBase:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_a
(
self
,
connect
,
collection
):
'''
target: test create partition, check status returned
...
...
@@ -28,7 +28,7 @@ class TestCreateBase:
connect
.
create_partition
(
collection
,
default_tag
)
# TODO: enable
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
@
pytest
.
mark
.
timeout
(
600
)
def
test_create_partition_limit
(
self
,
connect
,
collection
,
args
):
...
...
@@ -58,7 +58,7 @@ class TestCreateBase:
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
create_partition
(
collection
,
tag_tmp
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_repeat
(
self
,
connect
,
collection
):
'''
target: test create partition, check status returned
...
...
@@ -75,7 +75,7 @@ class TestCreateBase:
assert
message
==
"create partition failed: partition name = %s already exists"
%
default_tag
assert
compare_list_elements
(
connect
.
list_partitions
(
collection
),
[
default_tag
,
'_default'
])
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
def
test_create_partition_collection_not_existed
(
self
,
connect
):
'''
target: test create partition, its owner collection name not existed in db, check status returned
...
...
@@ -91,7 +91,7 @@ class TestCreateBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"create partition failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_tag_name_None
(
self
,
connect
,
collection
):
'''
target: test create partition, tag name set None, check status returned
...
...
@@ -104,7 +104,7 @@ class TestCreateBase:
except
Exception
as
e
:
assert
e
.
args
[
0
]
==
"`partition_tag` value None is illegal"
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_different_partition_tags
(
self
,
connect
,
collection
):
'''
target: test create partition twice with different names
...
...
@@ -116,7 +116,7 @@ class TestCreateBase:
connect
.
create_partition
(
collection
,
tag_name
)
assert
compare_list_elements
(
connect
.
list_partitions
(
collection
),
[
default_tag
,
tag_name
,
'_default'
])
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_insert_default
(
self
,
connect
,
id_collection
):
'''
target: test create partition, and insert vectors, check status returned
...
...
@@ -128,7 +128,7 @@ class TestCreateBase:
insert_ids
=
connect
.
insert
(
id_collection
,
default_entities
,
ids
)
assert
len
(
insert_ids
)
==
len
(
ids
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_insert_with_tag
(
self
,
connect
,
id_collection
):
'''
target: test create partition, and insert vectors, check status returned
...
...
@@ -140,7 +140,7 @@ class TestCreateBase:
insert_ids
=
connect
.
insert
(
id_collection
,
default_entities
,
ids
,
partition_tag
=
default_tag
)
assert
len
(
insert_ids
)
==
len
(
ids
)
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_insert_with_tag_not_existed
(
self
,
connect
,
collection
):
'''
target: test create partition, and insert vectors, check status returned
...
...
@@ -158,7 +158,7 @@ class TestCreateBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"partitionID of partitionName:%s can not be find"
%
tag_new
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_create_partition_insert_same_tags
(
self
,
connect
,
id_collection
):
'''
target: test create partition, and insert vectors, check status returned
...
...
@@ -176,7 +176,7 @@ class TestCreateBase:
res
=
connect
.
get_collection_stats
(
id_collection
)
assert
res
[
"row_count"
]
==
default_nb
*
2
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_create_partition_insert_same_tags_two_collections
(
self
,
connect
,
collection
):
'''
...
...
@@ -207,7 +207,7 @@ class TestShowBase:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_list_partitions
(
self
,
connect
,
collection
):
'''
target: test show partitions, check status and partitions returned
...
...
@@ -217,7 +217,7 @@ class TestShowBase:
connect
.
create_partition
(
collection
,
default_tag
)
assert
compare_list_elements
(
connect
.
list_partitions
(
collection
),
[
default_tag
,
'_default'
])
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_list_partitions_no_partition
(
self
,
connect
,
collection
):
'''
target: test show partitions with collection name, check status and partitions returned
...
...
@@ -227,7 +227,7 @@ class TestShowBase:
res
=
connect
.
list_partitions
(
collection
)
assert
compare_list_elements
(
res
,
[
'_default'
])
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_show_multi_partitions
(
self
,
connect
,
collection
):
'''
target: test show partitions, check status and partitions returned
...
...
@@ -255,7 +255,7 @@ class TestHasBase:
def
get_tag_name
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_partition_a
(
self
,
connect
,
collection
):
'''
target: test has_partition, check status and result
...
...
@@ -267,7 +267,7 @@ class TestHasBase:
logging
.
getLogger
().
info
(
res
)
assert
res
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_partition_multi_partitions
(
self
,
connect
,
collection
):
'''
target: test has_partition, check status and result
...
...
@@ -280,7 +280,7 @@ class TestHasBase:
res
=
connect
.
has_partition
(
collection
,
tag_name
)
assert
res
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_partition_tag_not_existed
(
self
,
connect
,
collection
):
'''
target: test has_partition, check status and result
...
...
@@ -291,7 +291,7 @@ class TestHasBase:
logging
.
getLogger
().
info
(
res
)
assert
not
res
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_has_partition_collection_not_existed
(
self
,
connect
,
collection
):
'''
target: test has_partition, check status and result
...
...
@@ -307,7 +307,7 @@ class TestHasBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"HasPartition failed: can't find collection: %s"
%
collection_name
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_has_partition_with_invalid_tag_name
(
self
,
connect
,
collection
,
get_tag_name
):
'''
...
...
@@ -329,7 +329,7 @@ class TestDropBase:
******************************************************************
"""
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_partition_a
(
self
,
connect
,
collection
):
'''
target: test drop partition, check status and partition if existed
...
...
@@ -343,7 +343,7 @@ class TestDropBase:
res2
=
connect
.
list_partitions
(
collection
)
assert
default_tag
not
in
res2
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_partition_tag_not_existed
(
self
,
connect
,
collection
):
'''
target: test drop partition, but tag not existed
...
...
@@ -360,7 +360,7 @@ class TestDropBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"DropPartition failed: partition %s does not exist"
%
new_tag
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_partition_tag_not_existed_A
(
self
,
connect
,
collection
):
'''
target: test drop partition, but collection not existed
...
...
@@ -377,7 +377,7 @@ class TestDropBase:
message
=
getattr
(
e
,
'message'
,
"The exception does not contain the field of message."
)
assert
message
==
"DropPartition failed: can't find collection: %s"
%
new_collection
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
@
pytest
.
mark
.
level
(
2
)
def
test_drop_partition_repeatedly
(
self
,
connect
,
collection
):
'''
...
...
@@ -398,7 +398,7 @@ class TestDropBase:
tag_list
=
connect
.
list_partitions
(
collection
)
assert
default_tag
not
in
tag_list
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_partition_create
(
self
,
connect
,
collection
):
'''
target: test drop partition, and create again, check status
...
...
@@ -429,7 +429,7 @@ class TestNameInvalid(object):
def
get_collection_name
(
self
,
request
):
yield
request
.
param
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_drop_partition_with_invalid_collection_name
(
self
,
connect
,
collection
,
get_collection_name
):
'''
...
...
@@ -442,7 +442,7 @@ class TestNameInvalid(object):
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
drop_partition
(
collection_name
,
default_tag
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_drop_partition_with_invalid_tag_name
(
self
,
connect
,
collection
,
get_tag_name
):
'''
...
...
@@ -455,7 +455,7 @@ class TestNameInvalid(object):
with
pytest
.
raises
(
Exception
)
as
e
:
connect
.
drop_partition
(
collection
,
tag_name
)
@
pytest
.
mark
.
tags
(
"0331"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
)
@
pytest
.
mark
.
level
(
2
)
def
test_list_partitions_with_invalid_collection_name
(
self
,
connect
,
collection
,
get_collection_name
):
'''
...
...
@@ -471,7 +471,7 @@ class TestNameInvalid(object):
class
TestNewCase
(
object
):
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_default_partition_A
(
self
,
connect
,
collection
):
'''
target: test drop partition of default, check status returned
...
...
@@ -488,7 +488,7 @@ class TestNewCase(object):
list_partition
=
connect
.
list_partitions
(
collection
)
assert
'_default'
in
list_partition
@
pytest
.
mark
.
tags
(
"0331"
,
"l1"
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
tags_0331
,
CaseLabel
.
tags_l1
,
CaseLabel
.
tags_smoke
)
def
test_drop_default_partition_B
(
self
,
connect
,
collection
):
'''
target: test drop partition of default, check status returned
...
...
tests/python_test/utils.py
浏览文件 @
3be6dde4
...
...
@@ -1005,3 +1005,9 @@ class MyThread(threading.Thread):
super
(
MyThread
,
self
).
join
()
if
self
.
exc
:
raise
self
.
exc
class
CaseLabel
:
tags_0331
=
"0331"
tags_l1
=
"l1"
tags_smoke
=
"smoke"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录