Skip to content

test: add query variant and data type round-trip tests (closes #101)#166

Merged
s2x merged 1 commit into
mainfrom
feat/issue-101-query-test-coverage
Jul 8, 2026
Merged

test: add query variant and data type round-trip tests (closes #101)#166
s2x merged 1 commit into
mainfrom
feat/issue-101-query-test-coverage

Conversation

@s2x

@s2x s2x commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #101

Changes

  • Add 8 .phpt test files for query variant and data type round-trip coverage:
    • test_query_by_id_nonexistent.phpt — queryById with non-existent/empty docId/fieldName
    • test_vector_int16_roundtrip.phpt — VECTOR_INT8 insert, fetch, and verification
    • test_uint64_roundtrip.phpt — UINT64 scalar round-trip
    • test_vector_binary32_roundtrip.phpt — VECTOR_INT8 insert/fetch (alternative pattern)
    • test_double_roundtrip.phpt — DOUBLE scalar round-trip
    • test_query_fp16.phpt — queryFp16, queryById, filter, includeVector
    • test_query_vector_object.phpt — queryVector with all ZVecVectorQuery options
    • test_query_fp64.phpt — XFAIL (upstream limitation)
  • Fix queryById() to detect FP16 vector fields when resolving query vectors
  • Update CHANGELOG.md with TEST-003 entry

Testing

  • 7/8 new tests pass (1 XFAIL for FP64 — upstream limitation)
  • Each test uses try-finally with uniqid() and cleanup
  • Tests skip when native zvec extension is loaded (FFI-only)

Notes

  • VECTOR_INT16 and VECTOR_BINARY32 replaced with VECTOR_INT8 (upstream v0.4.0 only supports FP32, FP16, INT8 as dense vector types)
  • queryById now handles FP16 vector fields (previously only checked FP32/FP64)

Code Review

  • Passed subagent code review
  • All review comments addressed

- Add 8 .phpt test files for query and data type coverage:
  - test_query_by_id_nonexistent, test_vector_int8_roundtrip (x2),
    test_uint64_roundtrip, test_double_roundtrip,
    test_query_fp16, test_query_vector_object, test_query_fp64 (XFAIL)
- Fix queryById() to detect FP16 vector fields when resolving query vectors
- Update CHANGELOG.md with TEST-003 entry
@s2x s2x self-assigned this Jul 8, 2026
@s2x
s2x merged commit edf6f7b into main Jul 8, 2026
3 checks passed
@s2x
s2x deleted the feat/issue-101-query-test-coverage branch July 8, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TEST-003: Query Methods — Missing Coverage

1 participant