diff --git a/.github/mergify.yml b/.github/mergify.yml index 75dbad33..4a22f0bc 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -26,8 +26,10 @@ pull_request_rules: - name: Test passed for code changed-main conditions: - - base=main - - check-success=Test + - check-success=test-backup-restore-cross-version + - check-success=test-backup-restore-after-upgrade + - check-success=test-backup-restore-cli + - check-success=test-backup-restore-api actions: label: add: diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b1d0ca6b..fdcebcb3 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,9 +24,11 @@ jobs: deploy_tools: [docker-compose] milvus_mode: [standalone] another_milvus_mode: [standalone] - source_image_tag: [2.2.0-latest, 2.3-latest] + source_image_tag: [2.3-latest, 2.4-latest] target_image_tag: [master-latest, 2.4-latest] - # mq_type: [pulsar, kafka] # TODO: add pulsar and kafka + exclude: + - source_image_tag: 2.4-latest + target_image_tag: 2.4-latest steps: - uses: actions/checkout@v3 @@ -64,7 +66,8 @@ jobs: shell: bash working-directory: deployment/${{ matrix.milvus_mode }} run: | - yq -i '.services.standalone.image="milvusdb/milvus:${{ matrix.source_image_tag }}"' docker-compose.yml + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.source_image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml docker-compose up -d bash ../../scripts/check_healthy.sh docker-compose ps -a @@ -120,7 +123,8 @@ jobs: shell: bash working-directory: deployment/${{ matrix.another_milvus_mode }} run: | - yq -i '.services.standalone.image="milvusdb/milvus:${{ matrix.target_image_tag }}"' docker-compose.yml + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.target_image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml docker-compose up -d bash ../../scripts/check_healthy.sh docker-compose ps -a @@ -159,9 +163,11 @@ jobs: deploy_tools: [docker-compose] milvus_mode: [standalone] another_milvus_mode: [standalone] - source_image_tag: [v2.3.12, 2.3-latest] - target_image_tag: [master-latest, 2.3-latest] - # mq_type: [pulsar, kafka] # TODO: add pulsar and kafka + source_image_tag: [v2.4.17, 2.4-latest] + target_image_tag: [master-latest, 2.4-latest] + exclude: + - source_image_tag: 2.4-latest + target_image_tag: 2.4-latest steps: - uses: actions/checkout@v3 @@ -199,7 +205,8 @@ jobs: shell: bash working-directory: deployment/${{ matrix.milvus_mode }} run: | - yq -i '.services.standalone.image="milvusdb/milvus:${{ matrix.source_image_tag }}"' docker-compose.yml + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.source_image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml docker-compose up -d bash ../../scripts/check_healthy.sh docker-compose ps -a @@ -216,7 +223,8 @@ jobs: working-directory: deployment/${{ matrix.another_milvus_mode }} run: | docker-compose down - yq -i '.services.standalone.image="milvusdb/milvus:${{ matrix.target_image_tag }}"' docker-compose.yml + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.target_image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml docker-compose up -d bash ../../scripts/check_healthy.sh docker-compose ps -a @@ -246,8 +254,9 @@ jobs: fail-fast: false matrix: deploy_tools: [docker-compose] - milvus_mode: [standalone, cluster] - another_milvus_mode: [standalone, cluster] + milvus_mode: [standalone] + another_milvus_mode: [standalone] + image_tag: [master-latest] # mq_type: [pulsar, kafka] # TODO: add pulsar and kafka steps: @@ -286,6 +295,8 @@ jobs: shell: bash working-directory: deployment/${{ matrix.milvus_mode }} run: | + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml docker-compose up -d bash ../../scripts/check_healthy.sh docker-compose ps -a @@ -371,135 +382,6 @@ jobs: run: | python example/verify_data.py - test-backup-restore-with-custom-config: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - deploy_tools: [helm] - milvus_mode: [standalone] - milvus_minio_rootpath: ["", "file"] - backup_bucket_name: ["milvus-backup", "milvus-bucket"] - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python 3.10 - uses: actions/setup-python@v5 - with: - python-version: '3.10' - cache: pip - - - uses: actions/setup-go@v3 - with: - go-version: '1.18.0' - cache: true - - - name: Creating kind cluster - if: ${{ matrix.deploy_tools == 'helm' }} - uses: helm/kind-action@v1.2.0 - - - name: Modify Milvus config - - timeout-minutes: 15 - shell: bash - working-directory: deployment/${{ matrix.milvus_mode }} - run: | - yq -i '.minio.rootPath = "${{ matrix.milvus_minio_rootpath }}"' values.yaml - - name: Build - timeout-minutes: 5 - shell: bash - run: | - if [ ${{ matrix.deploy_tools }} == 'helm' ]; then - yq -i '.minio.bucketName = "milvus-bucket"' configs/backup.yaml - yq -i '.minio.rootPath = "${{ matrix.milvus_minio_rootpath }}"' configs/backup.yaml - yq -i '.minio.backupBucketName = "${{ matrix.backup_bucket_name }}"' configs/backup.yaml - - fi - yq -i '.log.level = "debug"' configs/backup.yaml - cat configs/backup.yaml || true - go get - go build - - name: Install dependency - - timeout-minutes: 5 - working-directory: tests - shell: bash - run: | - pip install -r requirements.txt --trusted-host https://test.pypi.org - sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - - name: Milvus deploy - - timeout-minutes: 15 - shell: bash - working-directory: deployment/${{ matrix.milvus_mode }} - run: | - if [ ${{ matrix.deploy_tools}} == "helm" ]; then - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - helm install --wait --timeout 600s milvus-backup milvus/milvus -f values.yaml - kubectl get pods - kubectl port-forward service/milvus-backup 19530 >/dev/null 2>&1 & - kubectl port-forward service/milvus-backup-minio 9000 >/dev/null 2>&1 & - sleep 10 - nc -vz 127.0.0.1 19530 - nc -vz 127.0.0.1 9000 - sleep 10 - kubectl get pods -n default | grep milvus-backup - fi - - if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then - docker-compose up -d - bash ../../scripts/check_healthy.sh - docker-compose ps -a - fi - - name: Prepare data - timeout-minutes: 5 - shell: bash - run: | - python example/prepare_data.py - - name: Backup - timeout-minutes: 5 - shell: bash - run: | - ./milvus-backup check - ./milvus-backup list - ./milvus-backup create -n my_backup - ./milvus-backup list - - name: Restore backup - timeout-minutes: 5 - shell: bash - run: | - ./milvus-backup restore -n my_backup -s _recover - - name: Verify data - timeout-minutes: 5 - shell: bash - run: | - python example/verify_data.py - - name: Export logs - if: ${{ always() }} - shell: bash - working-directory: deployment/${{ matrix.milvus_mode }} - run: | - if [ ${{ matrix.deploy_tools}} == "helm" ]; then - bash ../../scripts/export_log_k8s.sh default milvus-backup logs - fi - - if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then - bash ../../scripts/export_log_docker.sh logs - fi - - - name: Upload logs - if: ${{ ! success() }} - uses: actions/upload-artifact@v4 - with: - name: custom-config-${{ matrix.deploy_tools }}-${{ matrix.milvus_mode }} - path: | - ./logs - ./server.log - /tmp/ci_logs - deployment/${{ matrix.milvus_mode }}/logs test-backup-restore-api: runs-on: ubuntu-latest needs: test-backup-restore-cli @@ -508,10 +390,10 @@ jobs: matrix: deploy_tools: [docker-compose] milvus_mode: [standalone] - image_tag: [master-latest, 2.3-latest, 2.4-latest] + image_tag: [master-latest, 2.4-latest] case_tag: [L0, L1, L2, MASTER] exclude: - - image_tag: 2.3-latest + - image_tag: 2.4-latest case_tag: MASTER steps: @@ -528,19 +410,10 @@ jobs: go-version: '1.18.0' cache: true - - name: Creating kind cluster - if: ${{ matrix.deploy_tools == 'helm' }} - uses: helm/kind-action@v1.2.0 - - name: Build timeout-minutes: 5 shell: bash run: | - if [ ${{ matrix.deploy_tools }} == 'helm' ]; then - yq -i '.minio.bucketName = "milvus-bucket"' configs/backup.yaml - yq -i '.minio.backupBucketName = "milvus-bucket"' configs/backup.yaml - yq -i '.minio.rootPath = "file"' configs/backup.yaml - fi yq -i '.log.level = "debug"' configs/backup.yaml cat configs/backup.yaml || true go get @@ -563,28 +436,13 @@ jobs: shell: bash working-directory: deployment/${{ matrix.milvus_mode }} run: | - if [ ${{ matrix.deploy_tools}} == "helm" ]; then - helm repo add milvus https://milvus-io.github.io/milvus-helm - helm repo update - helm install --wait --timeout 600s milvus-backup milvus/milvus -f values.yaml - kubectl get pods - kubectl port-forward service/milvus-backup 19530 >/dev/null 2>&1 & - kubectl port-forward service/milvus-backup-minio 9000 >/dev/null 2>&1 & - sleep 10 - nc -vz 127.0.0.1 19530 - nc -vz 127.0.0.1 9000 - sleep 10 - kubectl get pods -n default | grep milvus-backup - fi - - if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then - yq -i '.services.standalone.image="milvusdb/milvus:${{ matrix.image_tag }}"' docker-compose.yml - docker-compose up -d - bash ../../scripts/check_healthy.sh - docker-compose ps -a - fi + tag=$(python ../../scripts/get_image_tag_by_short_name.py --tag ${{ matrix.image_tag }}) && echo $tag + yq -i ".services.standalone.image=\"milvusdb/milvus:${tag}\"" docker-compose.yml + docker-compose up -d + bash ../../scripts/check_healthy.sh + docker-compose ps -a - - name: Start server + - name: Start backup server timeout-minutes: 5 shell: bash working-directory: build/deployment @@ -605,28 +463,29 @@ jobs: working-directory: deployment/${{ matrix.milvus_mode }} run: | docker-compose ps -a || true - kubectl get pods -n default || true - - name: Export logs + - name: Export Milvus logs if: ${{ always() }} shell: bash working-directory: deployment/${{ matrix.milvus_mode }} run: | - if [ ${{ matrix.deploy_tools}} == "helm" ]; then - bash ../../scripts/export_log_k8s.sh default milvus-backup logs - fi if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then bash ../../scripts/export_log_docker.sh logs fi + - name: Export Backup Server logs + if: ${{ always() }} + shell: bash + working-directory: build/deployment + run: | + docker-compose logs > /tmp/ci_logs/backup_server.log 2>&1 || true + - name: Upload logs if: ${{ ! success() }} uses: actions/upload-artifact@v4 with: name: api-test-logs-${{ matrix.deploy_tools }}-${{ matrix.milvus_mode }}-${{ matrix.image_tag }}-${{ matrix.case_tag }} path: | - ./logs - ./server.log /tmp/ci_logs deployment/${{ matrix.milvus_mode }}/logs diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 7a9d6dae..e8460c02 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -13,7 +13,7 @@ jobs: matrix: deploy_tools: [docker-compose] milvus_mode: [standalone] - milvus_version: [master-latest, 2.3.0-latest, 2.2.0-latest] + milvus_version: [master-latest, 2.4-latest] steps: - uses: actions/checkout@v3 @@ -125,3 +125,133 @@ jobs: ./server.log /tmp/ci_logs deployment/${{ matrix.milvus_mode }}/logs + + test-backup-restore-with-custom-config: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + deploy_tools: [helm] + milvus_mode: [standalone] + milvus_minio_rootpath: ["", "file"] + backup_bucket_name: ["milvus-backup", "milvus-bucket"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: pip + + - uses: actions/setup-go@v3 + with: + go-version: '1.18.0' + cache: true + + - name: Creating kind cluster + if: ${{ matrix.deploy_tools == 'helm' }} + uses: helm/kind-action@v1.2.0 + + - name: Modify Milvus config + + timeout-minutes: 15 + shell: bash + working-directory: deployment/${{ matrix.milvus_mode }} + run: | + yq -i '.minio.rootPath = "${{ matrix.milvus_minio_rootpath }}"' values.yaml + - name: Build + timeout-minutes: 5 + shell: bash + run: | + if [ ${{ matrix.deploy_tools }} == 'helm' ]; then + yq -i '.minio.bucketName = "milvus-bucket"' configs/backup.yaml + yq -i '.minio.rootPath = "${{ matrix.milvus_minio_rootpath }}"' configs/backup.yaml + yq -i '.minio.backupBucketName = "${{ matrix.backup_bucket_name }}"' configs/backup.yaml + + fi + yq -i '.log.level = "debug"' configs/backup.yaml + cat configs/backup.yaml || true + go get + go build + - name: Install dependency + + timeout-minutes: 5 + working-directory: tests + shell: bash + run: | + pip install -r requirements.txt --trusted-host https://test.pypi.org + sudo curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + - name: Milvus deploy + + timeout-minutes: 15 + shell: bash + working-directory: deployment/${{ matrix.milvus_mode }} + run: | + if [ ${{ matrix.deploy_tools}} == "helm" ]; then + helm repo add milvus https://milvus-io.github.io/milvus-helm + helm repo update + helm install --wait --timeout 600s milvus-backup milvus/milvus -f values.yaml + kubectl get pods + kubectl port-forward service/milvus-backup 19530 >/dev/null 2>&1 & + kubectl port-forward service/milvus-backup-minio 9000 >/dev/null 2>&1 & + sleep 10 + nc -vz 127.0.0.1 19530 + nc -vz 127.0.0.1 9000 + sleep 10 + kubectl get pods -n default | grep milvus-backup + fi + + if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then + docker-compose up -d + bash ../../scripts/check_healthy.sh + docker-compose ps -a + fi + - name: Prepare data + timeout-minutes: 5 + shell: bash + run: | + python example/prepare_data.py + - name: Backup + timeout-minutes: 5 + shell: bash + run: | + ./milvus-backup check + ./milvus-backup list + ./milvus-backup create -n my_backup + ./milvus-backup list + - name: Restore backup + timeout-minutes: 5 + shell: bash + run: | + ./milvus-backup restore -n my_backup -s _recover + - name: Verify data + timeout-minutes: 5 + shell: bash + run: | + python example/verify_data.py + - name: Export logs + if: ${{ always() }} + shell: bash + working-directory: deployment/${{ matrix.milvus_mode }} + run: | + if [ ${{ matrix.deploy_tools}} == "helm" ]; then + bash ../../scripts/export_log_k8s.sh default milvus-backup logs + fi + + if [ ${{ matrix.deploy_tools}} == "docker-compose" ]; then + bash ../../scripts/export_log_docker.sh logs + fi + + - name: Upload logs + if: ${{ ! success() }} + uses: actions/upload-artifact@v4 + with: + name: custom-config-${{ matrix.deploy_tools }}-${{ matrix.milvus_mode }} + path: | + ./logs + ./server.log + /tmp/ci_logs + deployment/${{ matrix.milvus_mode }}/logs diff --git a/.github/workflows/perf.yaml b/.github/workflows/perf.yaml index 277c1d30..5c7b6608 100644 --- a/.github/workflows/perf.yaml +++ b/.github/workflows/perf.yaml @@ -1,12 +1,6 @@ name: Perf Test on: - push: - branches: - - main - pull_request: - branches: - - main workflow_dispatch: schedule: - cron: '0 4 * * *' @@ -22,7 +16,7 @@ jobs: matrix: deploy_tools: [docker-compose] milvus_mode: [standalone] - milvus_version: [master-latest, 2.3.0-latest, 2.2.0-latest] + milvus_version: [master-latest, 2.4-latest] steps: - uses: actions/checkout@v3 diff --git a/OWNERS b/OWNERS index c024ec58..1f012e7b 100644 --- a/OWNERS +++ b/OWNERS @@ -3,6 +3,8 @@ filters: reviewers: - huanghaoyuanhhy - Thomas-HuWei + - zhuwenxing approvers: - huanghaoyuanhhy - - Thomas-HuWei \ No newline at end of file + - Thomas-HuWei + - zhuwenxing diff --git a/build_image.sh b/build_image.sh index b4739e3b..ef1d9f49 100644 --- a/build_image.sh +++ b/build_image.sh @@ -1,7 +1,7 @@ VERSION=$(git describe --tags --always) COMMIT=$(git rev-parse --short HEAD) -DATA=$(date +'%Y-%m-%dT%H:%M:%SZ') +DATE=$(date +'%Y-%m-%dT%H:%M:%SZ') -docker build -t milvusdb/milvus-backup:$VERSION --build-arg VERSION=$VERSION --build-arg COMMIT=$COMMIT --build-arg DATA=$DATA . +docker build -t milvusdb/milvus-backup:$VERSION --build-arg VERSION=$VERSION --build-arg COMMIT=$COMMIT --build-arg DATE=$DATE . docker tag milvusdb/milvus-backup:$VERSION milvusdb/milvus-backup:latest \ No newline at end of file diff --git a/deployment/cluster/values.yaml b/deployment/cluster/values.yaml index 483730d4..96beee80 100644 --- a/deployment/cluster/values.yaml +++ b/deployment/cluster/values.yaml @@ -7,11 +7,14 @@ image: pullPolicy: IfNotPresent etcd: - replicaCount: 3 + replicaCount: 1 image: repository: milvusdb/etcd tag: 3.5.0-r7 +dataNode: + replicas: 4 + minio: resources: requests: @@ -124,4 +127,4 @@ pulsar: defaultRetentionTimeInMinutes: "10080" defaultRetentionSizeInMB: "8192" backlogQuotaDefaultLimitGB: "8" - backlogQuotaDefaultRetentionPolicy: producer_exception \ No newline at end of file + backlogQuotaDefaultRetentionPolicy: producer_exception diff --git a/scripts/export_log_docker.sh b/scripts/export_log_docker.sh index 70d37188..95e69b22 100644 --- a/scripts/export_log_docker.sh +++ b/scripts/export_log_docker.sh @@ -16,7 +16,7 @@ do if [[ $container == milvus-* ]]; then echo "export logs for container $container " - docker logs $container > ./$log_dir/$container.log 2>&1 || echo "export logs for container $container failed" + docker logs $container > $log_dir/$container.log 2>&1 || echo "export logs for container $container failed" fi done echo "export logs done" diff --git a/scripts/get_image_tag_by_short_name.py b/scripts/get_image_tag_by_short_name.py new file mode 100644 index 00000000..b2f913ed --- /dev/null +++ b/scripts/get_image_tag_by_short_name.py @@ -0,0 +1,50 @@ +import requests +import argparse +from tenacity import retry, stop_after_attempt + +@retry(stop=stop_after_attempt(7)) +def get_image_tag_by_short_name(repository, tag, arch): + + # Send API request to get all tags start with prefix + # ${branch}-latest means the tag is a dev build + # master-latest -> master-$date-$commit + # 2.3.0-latest -> 2.3.0-$date-$commit + # latest means the tag is a release build + # latest -> v$version + splits = tag.split("-") + prefix = f"{splits[0]}-" if len(splits) > 1 else "v" + url = f"https://hub.docker.com/v2/repositories/{repository}/tags?name={prefix}&ordering=last_updated" + response = requests.get(url) + data = response.json() + + # Get the latest tag with the same arch and prefix + sorted_images = sorted(data["results"], key=lambda x: x["last_updated"], reverse=True) + # print(sorted_images) + candidate_tag = None + for tag_info in sorted_images: + # print(tag_info) + image_name = tag_info["name"] + if tag == "2.2.0-latest": # special case for 2.2.0-latest, for 2.2.0 branch, there is no arm amd and gpu as suffix + candidate_tag = image_name + else: + if arch in image_name and len(image_name.split("-"))==4: + candidate_tag = tag_info["name"] + else: + continue + if candidate_tag == tag: + continue + else: + return candidate_tag + + +if __name__ == "__main__": + argparse = argparse.ArgumentParser() + argparse.add_argument("--repository", type=str, default="milvusdb/milvus") + argparse.add_argument("--tag", type=str, default="master-latest") + argparse.add_argument("--arch", type=str, default="amd64") + args = argparse.parse_args() + if "latest" not in args.tag: + print(args.tag) + else: + res = get_image_tag_by_short_name(args.repository, args.tag, args.arch) + print(res) diff --git a/tests/base/client_base.py b/tests/base/client_base.py index 152d64df..798cae23 100644 --- a/tests/base/client_base.py +++ b/tests/base/client_base.py @@ -265,8 +265,8 @@ def prepare_data(self, name=None, db_name="default", nb=ct.default_nb, dim=ct.de collection_w = self.init_collection_wrap(name=name, schema=default_schema, active_trace=True) # create partitions if enable_partition: - for i in range(5): - partition_w = self.init_partition_wrap(collection_wrap=collection_w) + for i in range(3): + self.init_partition_wrap(collection_wrap=collection_w) assert collection_w.name == name if nb > 0: cf.insert_data(collection_w, nb=nb, is_binary=is_binary, auto_id=auto_id, dim=dim) diff --git a/tests/testcases/test_restore_backup.py b/tests/testcases/test_restore_backup.py index 82d41eda..df55dfdb 100644 --- a/tests/testcases/test_restore_backup.py +++ b/tests/testcases/test_restore_backup.py @@ -26,11 +26,11 @@ class TestRestoreBackup(TestcaseBase): """ Test case of end to end""" @pytest.mark.parametrize("nb", [3000]) - @pytest.mark.parametrize("is_auto_id", [True, False]) + @pytest.mark.parametrize("is_auto_id", [True]) @pytest.mark.parametrize("enable_partition", [False]) @pytest.mark.parametrize("is_async", [True, False]) - @pytest.mark.parametrize("collection_need_to_restore", [1, 2, 3]) - @pytest.mark.parametrize("collection_type", ["binary", "float", "all"]) + @pytest.mark.parametrize("collection_need_to_restore", [3]) + @pytest.mark.parametrize("collection_type", ["all"]) @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_back(self, collection_type, collection_need_to_restore, is_async, is_auto_id, enable_partition, nb): # prepare data @@ -83,14 +83,13 @@ def test_milvus_restore_back(self, collection_type, collection_need_to_restore, for name in restore_collections: self.compare_collections(name, name+suffix, verify_by_query=True) - @pytest.mark.tags(CaseLabel.L1) + @pytest.mark.tags(CaseLabel.L2) @pytest.mark.parametrize("nb", [3000]) @pytest.mark.parametrize("is_auto_id", [True]) @pytest.mark.parametrize("enable_partition", [True]) @pytest.mark.parametrize("is_async", [True]) - @pytest.mark.parametrize("collection_need_to_restore", [3]) + @pytest.mark.parametrize("collection_need_to_restore", [1]) @pytest.mark.parametrize("collection_type", ["all"]) - @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_back_with_multi_partition(self, collection_type, collection_need_to_restore, is_async, is_auto_id, enable_partition, nb): # prepare data names_origin = [] @@ -190,11 +189,11 @@ def test_milvus_restore_back_with_db_support(self): assert collection_name + suffix in res self.compare_collections(collection_name, collection_name + suffix) - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) - @pytest.mark.parametrize("include_json", [True, False]) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) + @pytest.mark.parametrize("include_json", [True]) @pytest.mark.tags(CaseLabel.L0) - def test_milvus_restore_back_with_new_feature_support(self, include_json, include_dynamic, include_partition_key): + def test_milvus_restore_back_with_json_dynamic_schema_partition_key(self, include_json, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) back_up_name = cf.gen_unique_str(backup_prefix) @@ -268,7 +267,7 @@ def test_milvus_restore_back_with_new_feature_support(self, include_json, includ @pytest.mark.parametrize("include_partition_key", [True]) @pytest.mark.parametrize("include_dynamic", [True]) @pytest.mark.parametrize("include_json", [True]) - @pytest.mark.tags(CaseLabel.MASTER) + @pytest.mark.tags(CaseLabel.L2) def test_milvus_restore_back_with_multi_json_datatype(self, include_json, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) @@ -349,8 +348,7 @@ def test_milvus_restore_back_with_multi_json_datatype(self, include_json, includ all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("drop_db", [True, False]) + @pytest.mark.parametrize("drop_db", [True]) @pytest.mark.parametrize("str_json", [True, False]) @pytest.mark.tags(CaseLabel.L0) def test_milvus_restore_with_db_collections(self, drop_db, str_json): @@ -413,9 +411,9 @@ def test_milvus_restore_with_db_collections(self, drop_db, str_json): if not drop_db: self.compare_collections(collection_name, collection_name + suffix) - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) - @pytest.mark.tags(CaseLabel.L0) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) + @pytest.mark.tags(CaseLabel.L2) def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) @@ -488,10 +486,9 @@ def test_milvus_restore_back_with_array_datatype(self, include_dynamic, include_ all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) - @pytest.mark.tags(CaseLabel.MASTER) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) + @pytest.mark.tags(CaseLabel.L2) def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) @@ -570,10 +567,9 @@ def test_milvus_restore_back_with_multi_vector_datatype(self, include_dynamic, i all_backup = [] assert back_up_name not in all_backup - - @pytest.mark.parametrize("include_partition_key", [True, False]) - @pytest.mark.parametrize("include_dynamic", [True, False]) - @pytest.mark.tags(CaseLabel.MASTER) + @pytest.mark.parametrize("include_partition_key", [True]) + @pytest.mark.parametrize("include_dynamic", [True]) + @pytest.mark.tags(CaseLabel.L1) def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, include_partition_key): self._connect() name_origin = cf.gen_unique_str(prefix) @@ -656,7 +652,7 @@ def test_milvus_restore_back_with_f16_bf16_datatype(self, include_dynamic, inclu @pytest.mark.parametrize("include_dynamic", [True]) @pytest.mark.parametrize("enable_text_match", [True]) @pytest.mark.tags(CaseLabel.MASTER) - def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic, include_partition_key, enable_text_match): + def test_milvus_restore_back_with_sparse_vector_text_match_datatype(self, include_dynamic, include_partition_key, enable_text_match): self._connect() name_origin = cf.gen_unique_str(prefix) back_up_name = cf.gen_unique_str(backup_prefix) @@ -739,7 +735,6 @@ def test_milvus_restore_back_with_sparse_vector_datatype(self, include_dynamic, all_backup = [] assert back_up_name not in all_backup - @pytest.mark.tags(CaseLabel.L1) def test_milvus_restore_back_with_delete(self): self._connect() @@ -844,7 +839,7 @@ def test_milvus_restore_back_with_upsert(self): output_fields = None self.compare_collections(name_origin, name_origin + suffix, output_fields=output_fields, verify_by_query=True) - @pytest.mark.tags(CaseLabel.MASTER) + @pytest.mark.tags(CaseLabel.L1) def test_milvus_restore_back_with_dup_pk(self): self._connect() name_origin = cf.gen_unique_str(prefix)