Repository navigation
fix(tests): teach CLI parity adapter the typed search-result envelope - #1384
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR #1370 changed `polylogue list --format json` for search-mode queries to emit a typed ranked-result envelope (`{"hits": [...], "limit": N, "next_cursor": ...}`) rather than a bare JSON array. The parity adapter at tests/infra/surfaces.py:307 still expected the bare array shape, causing `test_search_unique_token_parity` and `test_search_shared_token_parity` to fail on every search-mode case. Fix: when the parsed CLI output is a dict carrying a `hits` array, peel it and continue with the existing per-row id extraction. The list-mode and search-hit-mode shapes still work unchanged (both go through the same row loop). Updates the docstring to enumerate all three shapes the adapter now handles. Verification: - `nix develop --command pytest tests/unit/storage/test_surface_parity_adapters.py -q` → 10 passed (previously 2 failed). - No production code touched; test-infra only. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
c3e9741 to
21ebcc9
Compare
Summary
PR #1370 (typed ranked-result envelope) changed
polylogue list --format jsonfor search-mode queries to emit{"hits": [...], "limit": N, "next_cursor": ...}rather than a bare JSON array. The CLI parity adapter attests/infra/surfaces.py:307still expected a bare array and assertednot isinstance(parsed, list), causing bothtest_search_unique_token_parityandtest_search_shared_token_parityto fail on every search-mode case on master.Solution
When the parsed CLI output is a dict carrying a
hitsarray (the typed envelope shape), peel thehitsand continue with the existing per-row id extraction. The list-mode and search-hit-mode shapes still work unchanged — they hit the same row loop directly.Updated the inline doc to enumerate all three shapes the adapter now handles.
Verification
nix develop --command pytest tests/unit/storage/test_surface_parity_adapters.py -q→ 10 passed (was 2 failures on master).Scope
Single-file, test-infra-only change. Should land before #1379 / #1380 / #1382 (or alongside) so those PRs' CI runs are unmasked by this pre-existing failure.