41 Commits
Author SHA1 Message Date
131e2d0aee test: Add testcases for external table (#49378)
## Summary

- Expand Python MilvusClient external_table E2E coverage for schema
validation, lifecycle, DQL, refresh, indexing, read-only/write-blocked
behavior, and multi-format datasets.
- Cover parquet, lance-table, iceberg-table, and vortex basic format
flows with shared data builders and stricter assertions.
- Add REST v2 external collection coverage for external job APIs,
nullable vectors, custom database flow, and format matrix behavior.
- Move Vortex data generation to the Python 3.12 test environment and
remove the old sidecar helper scripts.
- Add Python 3.12 environment setup in `tests/scripts` so E2E scripts
create and activate the expected test runtime.

## Notes

- Vortex full-matrix coverage excludes fields that the current
`vortex-data==0.56.0` writer or Milvus refresh path cannot represent
consistently (`FixedSizeBinary`-backed vector fields and known
string/JSON fields).
- Chaos fault-injection coverage is included in the PR but was not run
against the shared validation instance because it mutates the
deployment.

## Validation

- `uv venv -p 3.12 .venv`
- `uv pip install --python .venv/bin/python -r requirements.txt`
- `pytest -q -x -n 6 milvus_client/test_milvus_client_external_table.py
--host 10.100.36.207 --port 19530 --minio_host 10.100.36.172
--minio_bucket external-table-pr49378-master`
  - `162 passed, 2 skipped in 176.78s`
- `pytest -q -x -n 6 testcases/test_external_collection_operations.py
--endpoint http://10.100.36.207:19530 --token root:Milvus --minio_host
10.100.36.172 --bucket_name external-table-pr49378-master`
  - `22 passed, 4 xfailed in 66.04s`
- `git diff --check`

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-19 14:16:29 +08:00
c5ee59af8d test: add e2e tests for FileResource feature (#47628)
## Summary
- Add 40 E2E tests for FileResource CRUD APIs and analyzer integration
(jieba, synonym, stop words, decompounder)
- Verify tokenization correctness with baseline comparison (with vs
without file resources)
- Test data generated at runtime, no static files committed

/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-12 10:32:10 +08:00
yanliang567andGitHub bdb56f6053 enhance: Optimize Python test logging from 60MB to 3-5MB per run (#47253)
## Summary

This PR optimizes Python test logging to reduce log file size from 60MB+
to 3-5MB per test run (90%+ reduction) while preserving full debugging
information for failed tests.

related issue:  #47256

### Key Improvements

- **Conditional Logging**: PASSED tests save only metadata, FAILED tests
preserve complete logs
- **Memory Buffering**: Eliminates runtime disk I/O (no file writes
during test execution)
- **Unified Reports**: Generates 2 formats
  - `test_report.json`: AI-friendly structured data
  - `test_report.html`: Human-readable with color-coded logs
- **Worker Parallelism**: Full support for `pytest -n` with data merging

### Performance Impact

| Metric | Before | After | Improvement |
|--------|--------|-------|-------------|
| **Log Size** (15K tests) | 60 MB | 3-5 MB | **-90%+** |
| **Memory Usage** (6 workers) | ~50 MB | ~450 MB | +400 MB |
| **CPU Overhead** | N/A | 0.0004% | Negligible |
| **Runtime I/O** | 75 seconds | 75 ms | **-99.9%** |

### Changes

**New Files:**
- `plugin/log_filter.py`: Conditional log handler with per-test memory
buffers
- `plugin/__init__.py`: Plugin package initialization

**Modified Files:**
- `config/log_config.py`: Simplified config (only JSON/HTML paths)
- `conftest.py`: Register log filter plugin
- `utils/util_log.py`: Removed redundant file handlers
- `utils/api_request.py`: Optimized API request logging
- `check/param_check.py`: Truncate long lists in error messages
- `common/common_func.py`: Removed verbose logging
- `pytest.ini`: Added log filter plugin

**Cleanup:**
- `milvus_client/test_add_field_feature.py`: Removed unused variable

### Test Plan

- [x] Syntax validation: All Python files pass `py_compile`
- [x] Module imports: All modules load successfully
- [x] Data structures: Verified serialization without report/buffer
objects
- [x] Log configuration: Confirmed only necessary attributes present
- [x] Small-scale test (17 tests):  Generated correct JSON + HTML
reports
- [x] Performance analysis: Memory/CPU profiling for 15K test scenario

### Example Output

**test_report.html** (human-readable):
- Beautiful color-coded UI
- Failed tests with full error traceback
- Expandable log sections by level (debug/info/warning/error)

**test_report.json** (AI-friendly):
```json
{
  "metadata": { "total_tests": 15000, ... },
  "summary": { "passed": 13500, "failed": 1500, ... },
  "tests": {
    "failed": [
      {
        "id": "test.py::test_func",
        "error": { "type": "AssertionError", ... },
        "logs": { "debug": [...], "error": [...] }
      }
    ]
  }
}
```

### Memory Safety

For the standard scenario (15K tests, 10% failure, 6 workers):
- Worker memory: ~53 MB each (318 MB total)
- Main process peak: ~112 MB
- Total system: **< 450 MB**  Safe

High-risk scenarios (>30% failure or >50K tests) may require optional
streaming optimizations (documented in performance analysis).

### Backward Compatibility

-  No breaking changes to external APIs
-  Existing test commands work unchanged
-  Compatible with all pytest plugins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2026-01-27 16:37:33 +08:00
zhuwenxingandGitHub f9ff0e8402 test: add testcases for add/alter/drop text embedding function (#46229)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-12-09 19:23:14 +08:00
zhuwenxingandGitHub 21008c1bd2 test: add rolling upgrade test scripts (#43109)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-07-17 14:26:52 +08:00
zhuwenxingandGitHub 76004eb6cf test: add model rerank testcases (#42657)
/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-06-27 10:48:43 +08:00
zhuwenxingandGitHub e99d2fc63e test: add default user and pwd (#42590)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-06-12 10:36:43 +08:00
zhuwenxingandGitHub e19c22d77f test: use service dns name as tei endpoint (#42565)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-06-10 11:38:34 +08:00
zhuwenxingandGitHub fa04fcbc3a test: Update default tei endpoint (#42079)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-05-26 19:06:31 +08:00
zhuwenxingandGitHub 6a12304d1e test: add alter collection checker (#41281)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-04-15 11:02:34 +08:00
zhuwenxingandGitHub 6889b0470e test: add text embedding function test (#40668)
/kind improvement

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-03-20 11:44:12 +08:00
zhuwenxingandGitHub 69fc9aa271 test: add empty sparse in import test (#40682)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2025-03-18 15:16:12 +08:00
yanliang567andGitHub 7d35d023a3 test: Remove the old get index params method (#40319)
related issue: https://github.com/milvus-io/milvus/issues/40156
remove the old get index params method and update the new one

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2025-03-04 17:12:06 +08:00
nicoandGitHub 5cdd906d4b test: update test cases and sdk version (#39443)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-02-11 18:42:45 +08:00
nicoandGitHub 93ce4b1c97 test: modify milvus client rbac test cases (#39079)
Signed-off-by: nico <cheng.yuan@zilliz.com>
2025-01-16 11:39:01 +08:00
zhuwenxingandGitHub e19b8f2114 test: update default value of pytest addoption (#38836)
/kind improvement

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-12-30 14:34:51 +08:00
ThreadDaoandGitHub ea339c13c6 test: add cases for async milvus client (#38699)
issue: #38697

Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2024-12-25 16:54:50 +08:00
binbinandGitHub 5304707393 test: Add test cases for rbac v2 (#38556)
Signed-off-by: binbin lv <binbin.lv@zilliz.com>
2024-12-24 18:06:48 +08:00
foxspyandGitHub 5ae347aba0 enhance: update knowhere version (#37688)
issue: #37665 #37631 #37620 #37587 #36906 
knowhere has add default nlist value, so some invalid param test ut with
no nlist param will be valid.

Signed-off-by: xianliang.li <xianliang.li@zilliz.com>
2024-11-15 10:10:31 +08:00
yanliang567andGitHub ba3b2a91a0 test: Remove useless common types and refine error assert in negative cases (#33023)
Related issue: #32653 

1. Remove some meaningless common types
2. Refine error assertion in negative cases
3. Remove some dup tests

---------

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2024-05-14 15:03:33 +08:00
zhuwenxingandGitHub aab7cc9ecd test: add freshness checker (#30280)
add freshness checker

insert/upsert --> query:  Get the time when it can be queried

delete --> query: Get the time when it can not be queried

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-01-29 12:09:01 +08:00
zhuwenxingandGitHub 72c81c8ae4 test: add multi-tenancy checker (#29635)
add multi-tenancy checker

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2024-01-03 15:20:49 +08:00
zhuwenxingandGitHub 5923f109a0 [test]Add concurrent test in ci (#27633)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2023-10-23 11:46:21 +08:00
ThreadDaoandGitHub 7bd4c6c2cb [cherry-pick] Add database and db rbac test cases (#23952) (#24685)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2023-06-29 15:38:23 +08:00
binbinandGitHub 31122a6858 Update high level api test cases (#25118)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2023-06-28 14:18:51 +08:00
zhuwenxingandGitHub b06e88153c [test] Add bulk insert test in ci (#24329)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2023-05-24 15:27:26 +08:00
zhuwenxingandGitHub d0de10282b [test]Fix getting minio ip error when milvus is installed by operator (#20207)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2022-10-31 19:35:35 +08:00
zhuwenxingandGitHub 992d163988 [test]Make secure param as bool type (#19194)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2022-09-14 18:18:33 +08:00
zhuwenxingandGitHub 61f320287b [test]Fix chaos test (#18694)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2022-08-17 18:04:51 +08:00
zhuwenxingandGitHub 4d94e465dc [test]Add auth optional for test (#18306)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
2022-07-18 17:14:28 +08:00
binbinandGitHub b60c7f9ba3 Support replica as input parameters and update test cases to adapt to different replicas (#16757)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2022-05-05 18:15:51 +08:00
ThreadDaoandGitHub 1c3abbb052 Update pymilvus version and consistency import (#15226)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2022-01-17 15:37:35 +08:00
yanliang567andGitHub a398a1eb1c Add debug log in pytest fixture (#14764)
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2022-01-04 19:39:23 +08:00
ThreadDaoandGitHub b1b2fe6517 [skip e2e] Add log with case collection name (#14700)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-12-31 19:03:18 +08:00
ThreadDaoandGitHub f7787d9f57 Rename old pymilvus utils to util_pymilvus (#13957)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-12-22 17:07:48 +08:00
ThreadDaoandGitHub b8a6a8dac0 Fix clean log without pytest xdist (#11518)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-11-09 20:23:40 +08:00
ThreadDaoandGitHub 3a8acb03ee Separate test logs of different xdist worker (#11495)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-11-09 19:14:26 +08:00
ThreadDaoandGitHub b6a7cf2964 Remove import star of conftest (#9286)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-10-05 21:42:14 +08:00
ThreadDaoandGitHub ac972a64a6 [skip ci] Reformat conftest file (#9226)
Signed-off-by: ThreadDao <yufen.zong@zilliz.com>
2021-10-04 20:16:01 +08:00
binbinandGitHub 068cc14313 Merge collection test cases from pymilvus and orm (#7414)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2021-09-01 19:43:59 +08:00
binbinandGitHub eff75c7701 Replace sdk source and merge tests and tests20 (#7182)
Signed-off-by: Binbin Lv <binbin.lv@zilliz.com>
2021-08-20 11:00:56 +08:00