From 3be6dde459e4a7b2b437f7633e57093ea33d3612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B4=AB=E6=99=B4?= Date: Tue, 23 Mar 2021 14:35:30 +0800 Subject: [PATCH] Add smoke tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 紫晴 --- .../Regression/PythonRegression.groovy | 2 +- internal/kv/etcd/etcd_kv.go | 51 +++++- internal/kv/minio/minio_kv.go | 59 ++++++- internal/util/performance/performace.go | 23 +++ .../collection/test_collection_count.py | 28 ++-- .../collection/test_collection_stats.py | 36 ++-- .../collection/test_create_collection.py | 28 ++-- .../collection/test_describe_collection.py | 16 +- .../collection/test_drop_collection.py | 12 +- .../collection/test_has_collection.py | 14 +- .../collection/test_list_collections.py | 12 +- .../collection/test_load_collection.py | 68 ++++---- tests/python_test/entity/test_insert.py | 136 +++++++-------- tests/python_test/entity/test_search.py | 158 +++++++++--------- tests/python_test/test_connect.py | 22 +-- tests/python_test/test_flush.py | 34 ++-- tests/python_test/test_index.py | 94 +++++------ tests/python_test/test_partition.py | 58 +++---- tests/python_test/utils.py | 6 + 19 files changed, 493 insertions(+), 364 deletions(-) create mode 100644 internal/util/performance/performace.go diff --git a/.jenkins/modules/Regression/PythonRegression.groovy b/.jenkins/modules/Regression/PythonRegression.groovy index b1c7d832d1..dad8a9bae6 100644 --- a/.jenkins/modules/Regression/PythonRegression.groovy +++ b/.jenkins/modules/Regression/PythonRegression.groovy @@ -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) { diff --git a/internal/kv/etcd/etcd_kv.go b/internal/kv/etcd/etcd_kv.go index d56cf9d624..daea9a4dad 100644 --- a/internal/kv/etcd/etcd_kv.go +++ b/internal/kv/etcd/etcd_kv.go @@ -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 + } + } +} diff --git a/internal/kv/minio/minio_kv.go b/internal/kv/minio/minio_kv.go index 53cee1e86c..652471a03c 100644 --- a/internal/kv/minio/minio_kv.go +++ b/internal/kv/minio/minio_kv.go @@ -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 + } + } +} diff --git a/internal/util/performance/performace.go b/internal/util/performance/performace.go new file mode 100644 index 0000000000..73c8d67c02 --- /dev/null +++ b/internal/util/performance/performace.go @@ -0,0 +1,23 @@ +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))) +} diff --git a/tests/python_test/collection/test_collection_count.py b/tests/python_test/collection/test_collection_count.py index 7567374854..ce3e9e688a 100644 --- a/tests/python_test/collection/test_collection_count.py +++ b/tests/python_test/collection/test_collection_count.py @@ -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 diff --git a/tests/python_test/collection/test_collection_stats.py b/tests/python_test/collection/test_collection_stats.py index 780c5bb430..ee078b2ee2 100644 --- a/tests/python_test/collection/test_collection_stats.py +++ b/tests/python_test/collection/test_collection_stats.py @@ -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 diff --git a/tests/python_test/collection/test_create_collection.py b/tests/python_test/collection/test_create_collection.py index d3d3863000..4d10cb7e1c 100644 --- a/tests/python_test/collection/test_create_collection.py +++ b/tests/python_test/collection/test_create_collection.py @@ -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) diff --git a/tests/python_test/collection/test_describe_collection.py b/tests/python_test/collection/test_describe_collection.py index 89772dec59..57e4a8e36e 100644 --- a/tests/python_test/collection/test_describe_collection.py +++ b/tests/python_test/collection/test_describe_collection.py @@ -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: diff --git a/tests/python_test/collection/test_drop_collection.py b/tests/python_test/collection/test_drop_collection.py index 326b3e52fb..129dad7c37 100644 --- a/tests/python_test/collection/test_drop_collection.py +++ b/tests/python_test/collection/test_drop_collection.py @@ -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: diff --git a/tests/python_test/collection/test_has_collection.py b/tests/python_test/collection/test_has_collection.py index 6c025e6c05..9876a40fc7 100644 --- a/tests/python_test/collection/test_has_collection.py +++ b/tests/python_test/collection/test_has_collection.py @@ -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: diff --git a/tests/python_test/collection/test_list_collections.py b/tests/python_test/collection/test_list_collections.py index 333630472b..8bbebd6406 100644 --- a/tests/python_test/collection/test_list_collections.py +++ b/tests/python_test/collection/test_list_collections.py @@ -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 diff --git a/tests/python_test/collection/test_load_collection.py b/tests/python_test/collection/test_load_collection.py index e0c50c815e..23710538bb 100644 --- a/tests/python_test/collection/test_load_collection.py +++ b/tests/python_test/collection/test_load_collection.py @@ -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: diff --git a/tests/python_test/entity/test_insert.py b/tests/python_test/entity/test_insert.py index 8001e280af..306fb53676 100644 --- a/tests/python_test/entity/test_insert.py +++ b/tests/python_test/entity/test_insert.py @@ -49,7 +49,7 @@ class TestInsertBase: 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_insert_with_empty_entity(self, connect, collection): ''' target: test insert with empty entity list @@ -60,7 +60,7 @@ class TestInsertBase: with pytest.raises(ParamError) as e: connect.insert(collection, entities) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_None(self, connect, collection): ''' target: test insert with None @@ -72,7 +72,7 @@ class TestInsertBase: connect.insert(collection, entity) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_collection_not_existed(self, connect): ''' target: test insert, with collection not existed @@ -84,7 +84,7 @@ class TestInsertBase: connect.insert(collection_name, default_entities) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_without_connect(self, dis_connect, collection): ''' target: test insert entities without connection @@ -95,7 +95,7 @@ class TestInsertBase: dis_connect.insert(collection, default_entities) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_drop_collection(self, connect, collection): ''' target: test delete collection after insert entities @@ -108,7 +108,7 @@ class TestInsertBase: assert connect.has_collection(collection) == False @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_flush_drop_collection(self, connect, collection): ''' target: test drop collection after insert entities for a while @@ -122,7 +122,7 @@ class TestInsertBase: assert connect.has_collection(collection) == False @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_create_index(self, connect, collection, get_simple_index): ''' target: test build index insert after entities @@ -138,7 +138,7 @@ class TestInsertBase: assert index == get_simple_index @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_after_create_index(self, connect, collection, get_simple_index): ''' target: test build index insert after vector @@ -153,7 +153,7 @@ class TestInsertBase: assert index == get_simple_index @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_search(self, connect, collection): ''' target: test search entity after insert entity after a while @@ -187,7 +187,7 @@ class TestInsertBase: yield request.param @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_ids(self, connect, id_collection, insert_count): ''' target: test insert entities in collection, use customize ids @@ -204,7 +204,7 @@ class TestInsertBase: assert stats[row_count] == nb @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_the_same_ids(self, connect, id_collection, insert_count): ''' target: test insert vectors in collection, use customize the same ids @@ -221,7 +221,7 @@ class TestInsertBase: assert stats[row_count] == nb @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_ids_fields(self, connect, get_filter_field, get_vector_field): ''' target: test create normal collection with different fields, insert entities into id with ids @@ -247,7 +247,7 @@ class TestInsertBase: assert stats[row_count] == nb @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_ids_not_match(self, connect, id_collection, insert_count): ''' target: test insert entities in collection without ids @@ -260,7 +260,7 @@ class TestInsertBase: # TODO @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_twice_ids_no_ids(self, connect, id_collection): ''' target: check the result of insert, with params ids and no ids @@ -273,7 +273,7 @@ class TestInsertBase: connect.insert(id_collection, default_entities) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_not_ids(self, connect, id_collection): ''' target: check the result of insert, with params ids and no ids @@ -284,7 +284,7 @@ class TestInsertBase: connect.insert(id_collection, default_entities) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_ids_length_not_match_batch(self, connect, id_collection): ''' target: test insert vectors in collection, use customize ids, len(ids) != len(vectors) @@ -297,7 +297,7 @@ class TestInsertBase: connect.insert(id_collection, default_entities, ids) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_ids_length_not_match_single(self, connect, id_collection): ''' target: test insert vectors in collection, use customize ids, len(ids) != len(vectors) @@ -310,7 +310,7 @@ class TestInsertBase: connect.insert(id_collection, default_entity, ids) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_partition(self, connect, collection): ''' target: test insert entities in collection created before @@ -327,7 +327,7 @@ class TestInsertBase: # TODO @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_partition_with_ids(self, connect, id_collection): ''' target: test insert entities in collection created before, insert with ids @@ -341,7 +341,7 @@ class TestInsertBase: logging.getLogger().info(connect.describe_collection(id_collection)) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_default_partition(self, connect, collection): ''' target: test insert entities into default partition @@ -355,7 +355,7 @@ class TestInsertBase: assert stats[row_count] == default_nb @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_partition_not_existed(self, connect, collection): ''' target: test insert entities in collection created before @@ -367,7 +367,7 @@ class TestInsertBase: connect.insert(collection, default_entities, partition_tag=tag) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_partition_repeatedly(self, connect, collection): ''' target: test insert entities in collection created before @@ -381,7 +381,7 @@ class TestInsertBase: res = connect.get_collection_stats(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_insert_dim_not_matched(self, connect, collection): ''' target: test insert entities, the vector dimension is not equal to the collection dimension @@ -394,7 +394,7 @@ class TestInsertBase: with pytest.raises(Exception) as e: connect.insert(collection, insert_entities) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_field_name_not_match(self, connect, collection): ''' target: test insert entities, with the entity field name updated @@ -406,7 +406,7 @@ class TestInsertBase: connect.insert(collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_field_type_not_match(self, connect, collection): ''' target: test insert entities, with the entity field type updated @@ -418,7 +418,7 @@ class TestInsertBase: connect.insert(collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_field_value_not_match(self, connect, collection): ''' target: test insert entities, with the entity field value updated @@ -429,7 +429,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_field_more(self, connect, collection): ''' target: test insert entities, with more fields than collection schema @@ -440,7 +440,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_field_vector_more(self, connect, collection): ''' target: test insert entities, with more fields than collection schema @@ -451,7 +451,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_field_less(self, connect, collection): ''' target: test insert entities, with less fields than collection schema @@ -462,7 +462,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_field_vector_less(self, connect, collection): ''' target: test insert entities, with less fields than collection schema @@ -473,7 +473,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_no_field_vector_value(self, connect, collection): ''' target: test insert entities, with no vector field value @@ -485,7 +485,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_no_field_vector_type(self, connect, collection): ''' target: test insert entities, with no vector field type @@ -497,7 +497,7 @@ class TestInsertBase: with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_with_no_field_vector_name(self, connect, collection): ''' target: test insert entities, with no vector field name @@ -512,7 +512,7 @@ class TestInsertBase: # todo fix timeout # @pytest.mark.level(2) # @pytest.mark.timeout(30) -# @pytest.mark.tags("0331") +# @pytest.mark.tags(CaseLabel.tags_0331) def test_collection_insert_rows_count_multi_threading(self, args, collection): ''' target: test collection rows_count is correct or not with multi threading @@ -565,7 +565,7 @@ class TestInsertBinary: request.param["metric_type"] = "JACCARD" return request.param - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_binary_entities(self, connect, binary_collection): ''' target: test insert entities in binary collection @@ -578,7 +578,7 @@ class TestInsertBinary: 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_insert_binary_partition(self, connect, binary_collection): ''' target: test insert entities and create partition tag @@ -593,7 +593,7 @@ class TestInsertBinary: stats = connect.get_collection_stats(binary_collection) assert stats[row_count] == default_nb - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_binary_multi_times(self, connect, binary_collection): ''' target: test insert entities multi times and final flush @@ -607,7 +607,7 @@ class TestInsertBinary: 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_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index): ''' target: test insert binary entities after build index @@ -622,7 +622,7 @@ class TestInsertBinary: assert index == get_binary_index @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): ''' target: test build index insert after vector @@ -636,7 +636,7 @@ class TestInsertBinary: index = connect.describe_index(binary_collection, binary_field_name) assert index == get_binary_index - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_binary_search(self, connect, binary_collection): ''' target: test search vector after insert vector after a while @@ -677,7 +677,7 @@ class TestInsertAsync: logging.getLogger().info("In callback check results") assert result - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_async(self, connect, collection, insert_count): ''' target: test insert vectors with different length of vectors @@ -691,7 +691,7 @@ class TestInsertAsync: assert len(ids) == nb @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_async_false(self, connect, collection, insert_count): ''' target: test insert vectors with different length of vectors @@ -704,7 +704,7 @@ class TestInsertAsync: connect.flush([collection]) assert len(ids) == nb - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_async_callback(self, connect, collection, insert_count): ''' target: test insert vectors with different length of vectors @@ -718,7 +718,7 @@ class TestInsertAsync: assert len(ids) == nb @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_async_long(self, connect, collection): ''' target: test insert vectors with different length of vectors @@ -735,7 +735,7 @@ class TestInsertAsync: assert stats[row_count] == nb @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_async_callback_timeout(self, connect, collection): ''' target: test insert vectors with different length of vectors @@ -749,7 +749,7 @@ class TestInsertAsync: stats = connect.get_collection_stats(collection) assert stats[row_count] == 0 - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_async_invalid_params(self, connect): ''' target: test insert vectors with different length of vectors @@ -763,7 +763,7 @@ class TestInsertAsync: ids = future.result() # #1339 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_async_invalid_params_raise_exception(self, connect, collection): ''' target: test insert vectors with different length of vectors @@ -795,7 +795,7 @@ class TestInsertMultiCollections: # pytest.skip("sq8h not support in CPU mode") return request.param - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_entity_multi_collections(self, connect): ''' target: test insert entities @@ -815,7 +815,7 @@ class TestInsertMultiCollections: assert stats[row_count] == default_nb @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_drop_collection_insert_entity_another(self, connect, collection): ''' target: test insert vector to collection_1 after collection_2 deleted @@ -830,7 +830,7 @@ class TestInsertMultiCollections: assert len(ids) == 1 @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_create_index_insert_entity_another(self, connect, collection, get_simple_index): ''' target: test insert vector to collection_2 after build index for collection_1 @@ -848,7 +848,7 @@ class TestInsertMultiCollections: connect.drop_collection(collection_name) @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_entity_create_index_another(self, connect, collection, get_simple_index): ''' target: test insert vector to collection_2 after build index for collection_1 @@ -867,7 +867,7 @@ class TestInsertMultiCollections: assert stats[row_count] == 1 @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_entity_sleep_create_index_another(self, connect, collection, get_simple_index): ''' target: test insert vector to collection_2 after build index for collection_1 for a while @@ -883,7 +883,7 @@ class TestInsertMultiCollections: assert stats[row_count] == 1 @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_entity_insert_entity_another(self, connect, collection): ''' target: test insert entity to collection_1 after search collection_2 @@ -901,7 +901,7 @@ class TestInsertMultiCollections: assert stats[row_count] == 1 @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_insert_entity_search_entity_another(self, connect, collection): ''' target: test insert entity to collection_1 after search collection_2 @@ -918,7 +918,7 @@ class TestInsertMultiCollections: assert stats[row_count] == 1 @pytest.mark.timeout(ADD_TIMEOUT) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_entity_sleep_search_entity_another(self, connect, collection): ''' target: test insert entity to collection_1 after search collection_2 a while @@ -1008,7 +1008,7 @@ class TestInsertInvalid(object): def get_field_vectors_value(self, request): yield request.param - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_ids_invalid(self, connect, id_collection, get_entity_id): ''' target: test insert, with using customize ids, which are not int64 @@ -1020,13 +1020,13 @@ class TestInsertInvalid(object): with pytest.raises(Exception): connect.insert(id_collection, default_entities, ids) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_collection_name(self, connect, get_collection_name): collection_name = get_collection_name with pytest.raises(Exception): connect.insert(collection_name, default_entity) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_partition_name(self, connect, collection, get_tag_name): tag_name = get_tag_name connect.create_partition(collection, default_tag) @@ -1036,27 +1036,27 @@ class TestInsertInvalid(object): else: connect.insert(collection, default_entity, partition_tag=tag_name) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_name(self, connect, collection, get_field_name): tmp_entity = update_field_name(copy.deepcopy(default_entity), "int64", get_field_name) with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_type(self, connect, collection, get_field_type): field_type = get_field_type tmp_entity = update_field_type(copy.deepcopy(default_entity), 'float', field_type) with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_value(self, connect, collection, get_field_int_value): field_value = get_field_int_value tmp_entity = update_field_type(copy.deepcopy(default_entity), 'int64', field_value) with pytest.raises(Exception): connect.insert(collection, tmp_entity) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_entity_value(self, connect, collection, get_field_vectors_value): tmp_entity = copy.deepcopy(default_entity) src_vector = tmp_entity[-1]["values"] @@ -1120,21 +1120,21 @@ class TestInsertInvalidBinary(object): yield request.param @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_name(self, connect, binary_collection, get_field_name): tmp_entity = update_field_name(copy.deepcopy(default_binary_entity), "int64", get_field_name) with pytest.raises(Exception): connect.insert(binary_collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_value(self, connect, binary_collection, get_field_int_value): tmp_entity = update_field_type(copy.deepcopy(default_binary_entity), 'int64', get_field_int_value) with pytest.raises(Exception): connect.insert(binary_collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_entity_value(self, connect, binary_collection, get_field_vectors_value): tmp_entity = copy.deepcopy(default_binary_entity) src_vectors = tmp_entity[-1]["values"] @@ -1143,7 +1143,7 @@ class TestInsertInvalidBinary(object): connect.insert(binary_collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_ids_invalid(self, connect, binary_id_collection, get_entity_id): ''' target: test insert, with using customize ids, which are not int64 @@ -1156,7 +1156,7 @@ class TestInsertInvalidBinary(object): connect.insert(binary_id_collection, default_binary_entities, ids) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_type(self, connect, binary_collection, get_field_type): field_type = get_field_type tmp_entity = update_field_type(copy.deepcopy(default_binary_entity), 'int64', field_type) @@ -1164,7 +1164,7 @@ class TestInsertInvalidBinary(object): connect.insert(binary_collection, tmp_entity) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_insert_with_invalid_field_entities_value(self, connect, binary_collection, get_field_vectors_value): tmp_entities = copy.deepcopy(default_binary_entities) src_vector = tmp_entities[-1]["values"] diff --git a/tests/python_test/entity/test_search.py b/tests/python_test/entity/test_search.py index c18ff168c5..30992bf75b 100644 --- a/tests/python_test/entity/test_search.py +++ b/tests/python_test/entity/test_search.py @@ -145,7 +145,7 @@ class TestSearchBase: def get_nq(self, request): yield request.param - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_search_flat(self, connect, collection, get_top_k, get_nq): ''' target: test basic search function, all the search params is correct, change top-k value @@ -166,7 +166,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_flat_top_k(self, connect, collection, get_nq): ''' target: test basic search function, all the search params is correct, change top-k value @@ -257,7 +257,7 @@ class TestSearchBase: assert res2[0][0].id == res[0][1].id assert res2[0][0].entity.get("int64") == res[0][1].entity.get("int64") - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_after_index(self, connect, collection, get_simple_index, get_top_k, get_nq): ''' @@ -286,7 +286,7 @@ class TestSearchBase: assert res[0]._distances[0] < epsilon assert check_id_result(res[0], ids[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_after_index_different_metric_type(self, connect, collection, get_simple_index): ''' target: test search with different metric_type @@ -310,7 +310,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_index_empty_partition(self, connect, collection, get_simple_index, get_top_k, get_nq): ''' @@ -344,7 +344,7 @@ class TestSearchBase: res = connect.search(collection, query, partition_tags=[default_tag]) assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) @pytest.mark.timeout(600) def test_search_index_partition(self, connect, collection, get_simple_index, get_top_k, get_nq): @@ -376,7 +376,7 @@ class TestSearchBase: assert check_id_result(res[0], ids[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_index_partition_not_existed(self, connect, collection, get_top_k, get_nq, get_simple_index): ''' @@ -397,7 +397,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: connect.search(collection, query, partition_tags=["new_tag"]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_index_partitions(self, connect, collection, get_simple_index, get_top_k): ''' @@ -433,7 +433,7 @@ class TestSearchBase: assert res[1]._distances[0] > epsilon connect.release_collection(collection) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_index_partitions_B(self, connect, collection, get_simple_index, get_top_k): ''' @@ -469,7 +469,7 @@ class TestSearchBase: assert res[1]._distances[0] < epsilon connect.release_collection(collection) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_ip_flat(self, connect, collection, get_simple_index, get_top_k, get_nq): ''' @@ -487,7 +487,7 @@ class TestSearchBase: assert res[0]._distances[0] >= 1 - gen_inaccuracy(res[0]._distances[0]) assert check_id_result(res[0], ids[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_ip_after_index(self, connect, collection, get_simple_index, get_top_k, get_nq): ''' @@ -513,7 +513,7 @@ class TestSearchBase: assert check_id_result(res[0], ids[0]) assert res[0]._distances[0] >= 1 - gen_inaccuracy(res[0]._distances[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_ip_index_empty_partition(self, connect, collection, get_simple_index, get_top_k, get_nq): ''' @@ -547,7 +547,7 @@ class TestSearchBase: res = connect.search(collection, query, partition_tags=[default_tag]) assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_ip_index_partitions(self, connect, collection, get_simple_index, get_top_k): ''' @@ -581,7 +581,7 @@ class TestSearchBase: # TODO: # assert res[1]._distances[0] >= 1 - gen_inaccuracy(res[1]._distances[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_without_connect(self, dis_connect, collection): ''' @@ -592,7 +592,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: res = dis_connect.search(collection, default_query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_collection_not_existed(self, connect): ''' target: search collection not existed @@ -603,7 +603,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: res = connect.search(collection_name, default_query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_search_distance_l2(self, connect, collection): ''' target: search collection, and check the result: distance @@ -623,7 +623,7 @@ class TestSearchBase: res = connect.search(collection, query) assert abs(np.sqrt(res[0]._distances[0]) - min(distance_0, distance_1)) <= gen_inaccuracy(res[0]._distances[0]) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_distance_l2_after_index(self, connect, id_collection, get_simple_index): ''' target: search collection, and check the result: distance @@ -654,7 +654,7 @@ class TestSearchBase: # TODO: # assert abs(np.sqrt(res[0]._distances[0]) - min_distance) <= tmp_epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_ip(self, connect, collection): ''' @@ -677,7 +677,7 @@ class TestSearchBase: res = connect.search(collection, query) assert abs(res[0]._distances[0] - max(distance_0, distance_1)) <= epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_distance_ip_after_index(self, connect, id_collection, get_simple_index): ''' target: search collection, and check the result: distance @@ -711,7 +711,7 @@ class TestSearchBase: # TODO: # assert abs(res[0]._distances[0] - max_distance) <= tmp_epsilon - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_search_distance_jaccard_flat_index(self, connect, binary_collection): ''' target: search binary_collection, and check the result: distance @@ -728,7 +728,7 @@ class TestSearchBase: res = connect.search(binary_collection, query) assert abs(res[0]._distances[0] - min(distance_0, distance_1)) <= epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_binary_flat_with_L2(self, connect, binary_collection): ''' @@ -743,7 +743,7 @@ class TestSearchBase: with pytest.raises(Exception) as e: connect.search(binary_collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_hamming_flat_index(self, connect, binary_collection): ''' @@ -761,7 +761,7 @@ class TestSearchBase: res = connect.search(binary_collection, query) assert abs(res[0][0].distance - min(distance_0, distance_1).astype(float)) <= epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_substructure_flat_index(self, connect, binary_collection): ''' @@ -780,7 +780,7 @@ class TestSearchBase: res = connect.search(binary_collection, query) assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_substructure_flat_index_B(self, connect, binary_collection): ''' @@ -800,7 +800,7 @@ class TestSearchBase: assert res[1][0].distance <= epsilon assert res[1][0].id == ids[1] - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_superstructure_flat_index(self, connect, binary_collection): ''' @@ -819,7 +819,7 @@ class TestSearchBase: res = connect.search(binary_collection, query) assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_superstructure_flat_index_B(self, connect, binary_collection): ''' @@ -841,7 +841,7 @@ class TestSearchBase: assert res[1][0].id in ids assert res[1][0].distance <= epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_distance_tanimoto_flat_index(self, connect, binary_collection): ''' @@ -859,7 +859,7 @@ class TestSearchBase: res = connect.search(binary_collection, query) assert abs(res[0][0].distance - min(distance_0, distance_1)) <= epsilon - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) @pytest.mark.timeout(300) def test_search_concurrent_multithreads(self, connect, args): @@ -895,7 +895,7 @@ class TestSearchBase: for t in threads: t.join() - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) @pytest.mark.timeout(300) def test_search_concurrent_multithreads_single_connection(self, connect, args): @@ -930,7 +930,7 @@ class TestSearchBase: for t in threads: t.join() - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_search_multi_collections(self, connect, args): ''' @@ -985,7 +985,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_no_must(self, connect, collection): ''' method: build query without must expr @@ -996,7 +996,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_no_vector_term_only(self, connect, collection): ''' method: build query without vector only term @@ -1010,7 +1010,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_no_vector_range_only(self, connect, collection): ''' method: build query without vector only range @@ -1024,7 +1024,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_vector_only(self, connect, collection): entities, ids = init_data(connect, collection) connect.load_collection(collection) @@ -1032,7 +1032,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == default_top_k - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_wrong_format(self, connect, collection): ''' method: build query without must expr, with wrong expr name @@ -1046,7 +1046,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_empty(self, connect, collection): ''' method: search with empty query @@ -1062,7 +1062,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_value_not_in(self, connect, collection): ''' @@ -1079,7 +1079,7 @@ class TestSearchDSL(object): assert len(res[0]) == 0 # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_value_all_in(self, connect, collection): ''' @@ -1095,7 +1095,7 @@ class TestSearchDSL(object): assert len(res[0]) == 1 # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_values_not_in(self, connect, collection): ''' @@ -1112,7 +1112,7 @@ class TestSearchDSL(object): assert len(res[0]) == 0 # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_term_values_all_in(self, connect, collection): ''' method: build query with vector and term expr, with all term can be filtered @@ -1132,7 +1132,7 @@ class TestSearchDSL(object): assert result.id in ids[:limit] # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_term_values_parts_in(self, connect, collection): ''' method: build query with vector and term expr, with parts of term can be filtered @@ -1149,7 +1149,7 @@ class TestSearchDSL(object): assert len(res[0]) == default_top_k # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_values_repeat(self, connect, collection): ''' @@ -1167,7 +1167,7 @@ class TestSearchDSL(object): assert len(res[0]) == 1 # TODO: - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_term_value_empty(self, connect, collection): ''' method: build query with term value empty @@ -1180,7 +1180,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == 0 - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_complex_dsl(self, connect, collection): ''' method: query with complicated dsl @@ -1203,7 +1203,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_key_error(self, connect, collection): ''' @@ -1223,7 +1223,7 @@ class TestSearchDSL(object): def get_invalid_term(self, request): return request.param - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_wrong_format(self, connect, collection, get_invalid_term): ''' @@ -1237,7 +1237,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_field_named_term(self, connect, collection): ''' @@ -1265,7 +1265,7 @@ class TestSearchDSL(object): assert len(res[0]) == default_top_k connect.drop_collection(collection_term) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_term_one_field_not_existed(self, connect, collection): ''' @@ -1286,7 +1286,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_range_key_error(self, connect, collection): ''' method: build query with range key error @@ -1305,7 +1305,7 @@ class TestSearchDSL(object): def get_invalid_range(self, request): return request.param - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_range_wrong_format(self, connect, collection, get_invalid_range): ''' @@ -1319,7 +1319,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_range_string_ranges(self, connect, collection): ''' @@ -1334,7 +1334,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_range_invalid_ranges(self, connect, collection): ''' @@ -1357,7 +1357,7 @@ class TestSearchDSL(object): def get_valid_ranges(self, request): return request.param - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_range_valid_ranges(self, connect, collection, get_valid_ranges): ''' @@ -1374,7 +1374,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == default_top_k - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_range_one_field_not_existed(self, connect, collection): ''' method: build query with two fields ranges, one of fields not existed @@ -1394,7 +1394,7 @@ class TestSearchDSL(object): ************************************************************************ """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_multi_term_has_common(self, connect, collection): ''' @@ -1411,7 +1411,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == default_top_k - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_multi_term_no_common(self, connect, collection): ''' @@ -1428,7 +1428,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_multi_term_different_fields(self, connect, collection): ''' method: build query with multi range with same field, and ranges no common @@ -1445,7 +1445,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_single_term_multi_fields(self, connect, collection): ''' @@ -1461,7 +1461,7 @@ class TestSearchDSL(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_multi_range_has_common(self, connect, collection): ''' @@ -1478,7 +1478,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == default_top_k - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_multi_range_no_common(self, connect, collection): ''' @@ -1495,7 +1495,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_multi_range_different_fields(self, connect, collection): ''' @@ -1512,7 +1512,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == 0 - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_single_range_multi_fields(self, connect, collection): ''' @@ -1534,7 +1534,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_single_term_range_has_common(self, connect, collection): ''' @@ -1551,7 +1551,7 @@ class TestSearchDSL(object): assert len(res) == nq assert len(res[0]) == default_top_k - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_single_term_range_no_common(self, connect, collection): ''' method: build query with single term single range @@ -1573,7 +1573,7 @@ class TestSearchDSL(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_multi_vectors_same_field(self, connect, collection): ''' method: build query with two vectors same field @@ -1597,7 +1597,7 @@ class TestSearchDSLBools(object): ****************************************************************** """ - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) @pytest.mark.level(2) def test_query_no_bool(self, connect, collection): ''' @@ -1610,7 +1610,7 @@ class TestSearchDSLBools(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_should_only_term(self, connect, collection): ''' method: build query without must, with should.term instead @@ -1621,7 +1621,7 @@ class TestSearchDSLBools(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_query_should_only_vector(self, connect, collection): ''' method: build query without must, with should.vector instead @@ -1632,7 +1632,7 @@ class TestSearchDSLBools(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_must_not_only_term(self, connect, collection): ''' method: build query without must, with must_not.term instead @@ -1643,7 +1643,7 @@ class TestSearchDSLBools(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_must_not_vector(self, connect, collection): ''' method: build query without must, with must_not.vector instead @@ -1654,7 +1654,7 @@ class TestSearchDSLBools(object): with pytest.raises(Exception) as e: res = connect.search(collection, query) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_query_must_should(self, connect, collection): ''' method: build query must, and with should.term @@ -1710,14 +1710,14 @@ class TestSearchInvalid(object): return request.param @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_invalid_collection(self, connect, get_collection_name): collection_name = get_collection_name with pytest.raises(Exception) as e: res = connect.search(collection_name, default_query) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_invalid_partition(self, connect, collection, get_invalid_partition): # tag = " " tag = get_invalid_partition @@ -1725,14 +1725,14 @@ class TestSearchInvalid(object): res = connect.search(collection, default_query, partition_tags=tag) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_invalid_field_name(self, connect, collection, get_invalid_field): fields = [get_invalid_field] with pytest.raises(Exception) as e: res = connect.search(collection, default_query, fields=fields) @pytest.mark.level(1) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_search_with_not_existed_field(self, connect, collection): fields = [gen_unique_str("field_name")] with pytest.raises(Exception) as e: @@ -1750,7 +1750,7 @@ class TestSearchInvalid(object): yield request.param @pytest.mark.level(1) - @pytest.mark.tags("0331", "l1") + @pytest.mark.tags(CaseLabel.tags_0331, CaseLabel.tags_l1, CaseLabel.tags_smoke) def test_search_with_invalid_top_k(self, connect, collection, get_top_k): ''' target: test search function, with the wrong top_k @@ -1774,7 +1774,7 @@ class TestSearchInvalid(object): yield request.param @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_invalid_params(self, connect, collection, get_simple_index, get_search_params): ''' target: test search function, with the wrong nprobe @@ -1797,7 +1797,7 @@ class TestSearchInvalid(object): res = connect.search(collection, query) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_invalid_params_binary(self, connect, binary_collection): ''' target: test search function, with the wrong nprobe @@ -1816,7 +1816,7 @@ class TestSearchInvalid(object): res = connect.search(binary_collection, query) @pytest.mark.level(2) - @pytest.mark.tags("0331") + @pytest.mark.tags(CaseLabel.tags_0331) def test_search_with_empty_params(self, connect, collection, args, get_simple_index): ''' target: test search function, with empty search params diff --git a/tests/python_test/test_connect.py b/tests/python_test/test_connect.py index a3e40b4c6d..7baa2e9d0e 100644 --- a/tests/python_test/test_connect.py +++ b/tests/python_test/test_connect.py @@ -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 diff --git a/tests/python_test/test_flush.py b/tests/python_test/test_flush.py index 72eb5a6757..4382a333a4 100644 --- a/tests/python_test/test_flush.py +++ b/tests/python_test/test_flush.py @@ -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 diff --git a/tests/python_test/test_index.py b/tests/python_test/test_index.py index 7468213b56..dc63abcbb9 100644 --- a/tests/python_test/test_index.py +++ b/tests/python_test/test_index.py @@ -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): ''' diff --git a/tests/python_test/test_partition.py b/tests/python_test/test_partition.py index 44a5555da6..92d347bd62 100644 --- a/tests/python_test/test_partition.py +++ b/tests/python_test/test_partition.py @@ -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 diff --git a/tests/python_test/utils.py b/tests/python_test/utils.py index cfc0efaa1b..b3c5ef380b 100644 --- a/tests/python_test/utils.py +++ b/tests/python_test/utils.py @@ -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"