Skip to content

Commit ee7b531

Browse files
XuanYang-cnclaudewarp-agent
authored
enhance: Add ut to increase ut coverage (#3233)
1. test: remove xfail tests for better coverage clarity 2. test: consolidate duplicate array extraction tests into parametrized tests 3. test: reorganize entity_helper tests into logical submodules 4. test: add comprehensive tests for - pymilvus/client/types.py - iterator utility functions - pymilvus/orm/utility.py timestamp functions - Prepare request builder methods - pymilvus/client/abstract.py - decorator edge case tests - pymilvus/client/utils.py --------- Signed-off-by: yangxuan <xuan.yang@zilliz.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Warp <agent@warp.dev>
1 parent bfbb116 commit ee7b531

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+18171
-3898
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
- name: Upload coverage to Codecov
4242
uses: codecov/codecov-action@v5
4343
with:
44-
token: ${{ secrets.PYMILVUS_CODE_COV_TOKEN}}
44+
token: ${{ secrets.PYMILVUS_CODE_COV_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ htmlcov/
3535
**/debug/
3636
.codecov.yml
3737
coverage.xml
38+
junit.xml
3839

3940
# Example data
4041
/examples/bulk_writer
@@ -45,6 +46,7 @@ uv.lock
4546
# AI rules
4647
WARP.md
4748
CLAUDE.md
49+
AGENTS.md
4850

4951
# perf
5052
*.svg

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ format:
1111
PYTHONPATH=`pwd` python3 -m ruff check pymilvus tests --fix
1212

1313
coverage:
14-
PYTHONPATH=`pwd` pytest --cov=pymilvus --ignore=tests/benchmark --cov-report=html tests -x -v -rxXs
14+
PYTHONPATH=`pwd` pytest --cov=pymilvus --ignore=tests/benchmark tests --cov-report=xml
1515

1616
example:
1717
PYTHONPATH=`pwd` python examples/example.py

pymilvus/client/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def __repr__(self) -> str:
302302
return f"""
303303
CompactionState
304304
- compaction id: {self.compaction_id}
305-
- State: {self.state}
305+
- State: {self.state.name}
306306
- executing plan number: {self.in_executing}
307307
- timeout plan number: {self.in_timeout}
308308
- complete plan number: {self.completed}
@@ -332,7 +332,7 @@ def __repr__(self) -> str:
332332
return f"""
333333
Compaction Plans:
334334
- compaction id: {self.compaction_id}
335-
- state: {self.state}
335+
- state: {self.state.name}
336336
- plans: {self.plans}
337337
"""
338338

pyproject.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,18 @@ builtins-ignorelist = [
221221
"filter",
222222
]
223223
builtins-allowed-modules = ["types"]
224+
225+
[tool.coverage.run]
226+
omit = [
227+
"pymilvus/grpc_gen/*",
228+
]
229+
230+
[tool.coverage.report]
231+
omit = [
232+
"pymilvus/grpc_gen/*",
233+
]
234+
exclude_lines = [
235+
"pragma: no cover",
236+
"if TYPE_CHECKING:",
237+
"raise NotImplementedError",
238+
]

tests/async_grpc_handler/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)