Skip to content

test: add coverage tests for rabitq_split, mmap_io, warp, and c_api#2148

Merged
LHT129 merged 1 commit into
antgroup:mainfrom
LHT129:opencode/fill-main-cpp-coverage-gap
Jun 8, 2026
Merged

test: add coverage tests for rabitq_split, mmap_io, warp, and c_api#2148
LHT129 merged 1 commit into
antgroup:mainfrom
LHT129:opencode/fill-main-cpp-coverage-gap

Conversation

@LHT129
Copy link
Copy Markdown
Collaborator

@LHT129 LHT129 commented Jun 7, 2026

Summary

  • Add unit tests for RaBitQSplitDataCell: InsertVector, UpdateVector, Serialize/Deserialize, Encode/Decode, Resize, ShrinkToFit, Move, ExportModel, MergeOther, QueryWithDistanceFilter, IP metric
  • Add unit tests for MMapIO: directory path error handling, resize shrink, MultiRead, existing file reopen
  • Add functional test for Warp: multiple dimensions with IP metric
  • Existing vsag_c_api tests: null handles, invalid inputs, update failures, serialize edge cases

Addresses the main branch coverage gap (currently 87.92%, target 90%). Focuses on the highest-miss files identified via Codecov: rabitq_split_datacell.h (231 miss), warp.cpp (107 miss), mmap_io.cpp (43 miss), vsag_c_api.cpp (91 miss).

Test plan

  • All new tests pass locally (debug build)
  • CI coverage workflow runs and shows coverage improvement
  • No regressions in existing tests

🤖 Generated with Claude Code

@LHT129 LHT129 added kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) version/1.0 labels Jun 7, 2026
@LHT129 LHT129 self-assigned this Jun 7, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jun 7, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Require kind label

Wonderful, this rule succeeded.
  • label~=^kind/

🟢 Require version label

Wonderful, this rule succeeded.
  • label~=^version/

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds comprehensive unit and functional tests for several components, including RaBitQSplitDataCell, MMapIO, the VSAG C API, and Warp IP with multiple dimensions. The review feedback highlights several critical issues in the newly added tests: a potential robustness issue where the C API silently returns success on null handles, a test section that fails to call the method it is supposed to test (ComputePairVectors), ignored return values for Decode and Read operations, and potential undefined behavior due to an unchecked stat system call. Addressing these issues will significantly improve the reliability and correctness of the test suite.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/vsag_c_api_test.cpp Outdated
Comment thread src/datacell/flatten_datacell_test.cpp Outdated
Comment thread src/datacell/flatten_datacell_test.cpp
Comment thread src/io/mmap_io_test.cpp
Comment thread src/vsag_c_api_test.cpp
@LHT129 LHT129 force-pushed the opencode/fill-main-cpp-coverage-gap branch from 460421b to 7a52013 Compare June 8, 2026 03:04
Cover previously untested paths to improve main branch coverage toward 90%:
- RaBitQSplitDataCell: InsertVector, UpdateVector, Serialize/Deserialize,
  Encode/Decode, Resize, ShrinkToFit, Move, ExportModel, MergeOther,
  QueryWithDistanceFilter, IP metric instantiation
- MMapIO: directory path error, resize shrink, MultiRead, existing file
- Warp: multiple dimensions with IP metric
- vsag_c_api: null handles, invalid inputs, update failures, serialize edges

Signed-off-by: LHT129 <tianlan.lht@antgroup.com>
@LHT129 LHT129 force-pushed the opencode/fill-main-cpp-coverage-gap branch from 7a52013 to 618856c Compare June 8, 2026 04:17
Copy link
Copy Markdown
Collaborator

@wxyucs wxyucs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@LHT129 LHT129 merged commit 20a85bb into antgroup:main Jun 8, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/improvement Code improvements (variable/function renaming, refactoring, etc. ) module/testing size/XL version/1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants