Skip to content

test(gemini): add missing schema conversion edge case tests#1702

Merged
bug-ops merged 3 commits intomainfrom
test-gemini-add-missing-schema
Mar 13, 2026
Merged

test(gemini): add missing schema conversion edge case tests#1702
bug-ops merged 3 commits intomainfrom
test-gemini-add-missing-schema

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Mar 13, 2026

Closes #1637. Part of #1592.

Summary

  • test_normalize_schema_oneof_option_patternoneOf Option treated identically to anyOf (null variant stripped, nullable: true set)
  • test_normalize_schema_anyof_null_first_order — null-first anyOf order [{type:"null"}, {type:T}] correctly extracts T
  • test_inline_refs_unknown_ref_fallback$ref pointing to missing key falls back to {type: OBJECT, description: "unresolved reference"}
  • test_inline_refs_nested_multi_level — chained $ref chain A→B→C fully resolves to leaf type/description
  • test_build_tool_request_parameterless_tools_still_includes_tools_field — tools with empty-object schemas still produce non-empty declarations (second empty-guard path)

Test plan

  • cargo nextest run -p zeph-llm --lib — 608 tests pass (+5 new)
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --features full -- -D warnings — 0 warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins — 5305 passed

Covers five previously untested paths in the Gemini schema pipeline:
- oneOf Option<T> pattern (same handling as anyOf)
- null-first anyOf order: [{type:"null"}, {type:T}]
- unknown $ref fallback (→ OBJECT / "unresolved reference")
- nested multi-level $ref chain (A→B→C leaf resolution)
- parameterless tools still produce non-empty declarations

Part of #1592.
@github-actions github-actions bot added documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes tests Test-related changes size/M Medium PR (51-200 lines) labels Mar 13, 2026
@github-actions github-actions bot removed the tests Test-related changes label Mar 13, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 13, 2026 22:11
@github-actions github-actions bot added the tests Test-related changes label Mar 13, 2026
@bug-ops bug-ops merged commit 42d27f5 into main Mar 13, 2026
15 checks passed
@bug-ops bug-ops deleted the test-gemini-add-missing-schema branch March 13, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation llm zeph-llm crate (Ollama, Claude) rust Rust code changes size/M Medium PR (51-200 lines) tests Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(gemini): add missing schema conversion edge case tests

1 participant