Qt-removal R7.3: port 3 confirmed test-coverage gaps into backend/tests/#141
Merged
Merged
Conversation
Closes the 3 test-coverage gaps identified during R7 scoping for Qt-free survivor modules backend/ imports directly but had no backend/tests coverage for their own validation/caching/schema logic: - test_chart_data_validation.py: canonicalize_chart_data's own ChartDataError branch (non-finite numbers, wrong container types, sankey cycles) plus ChartDataAgent.validate_chart_data's delegation and in-place canonicalization contract. Previously only the "unsupported chart_type string" rejection path was covered. - test_ollama_capability_cache.py: api_provider's Ollama capability cache invalidation rules (a real historical bug fix - the cache never expired before, so a model gaining a capability via a fresh pull mid-session kept a stale cached answer). - test_settings.py: SettingsManager.schema_version fresh-file default and old-file backfill-on-load behavior. Each new file's docstring documents what was deliberately NOT ported: the Qt-tainted half of each legacy test file (ModelPullWorkerThread, ChatScene/SceneSerializer chat-payload schema versioning) has no backend/ equivalent yet to test against, so porting those would test nothing real. Every new test was mutation-tested against the actual production code to confirm it fails when the logic it covers breaks. Burn-down pin unchanged at 152/84/68 - this increment adds test coverage only and touches zero Qt files. Full suite: 2387 passed (2375 baseline + 12 new). Frontend unaffected: 1053 vitest + build clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the 3 test-coverage gaps identified during the R7 scoping recon: Qt-free survivor modules (
graphlink_chart_data.py/graphlink_chart_agent.py,api_provider.py,graphlink_licensing.py) thatbackend/imports and uses in live production paths, but whose own validation/caching/schema logic had zerobackend/testscoverage.What Changed
backend/tests/test_chart_data_validation.py(new, 4 tests) —canonicalize_chart_data's ownChartDataErrorbranch (non-finite numbers, wrong container types, sankey-cycle rejection, duplicate-flow aggregation) andChartDataAgent.validate_chart_data's delegation + in-place canonicalization contract.backend/tests/test_ollama_capability_cache.py(new, 6 tests) —api_provider's Ollama capability cache invalidation rules, ported from the legacy suite plus one new test proving the cache actually caches.backend/tests/test_settings.py(+2 tests) —SettingsManager.schema_versionfresh-file default and old-file backfill-on-load.Each file's docstring documents what was deliberately not ported: the Qt-tainted half of each legacy test (
ModelPullWorkerThread,ChatScene/SceneSerializerchat-payload schema versioning) has nobackend/equivalent yet, so porting those would test nothing real.Why
canvas.py:32,agents.py:75,agents.py:72,response_parsing.py:25), not legacy-only code — they needed real coverage before the R7.6 cutover deletes the legacy Qt app and its tests.Validation
python -m compileall -q .passes (repo root)tests/test_no_qt_anywhere.py— burn-down pin unchanged at 152/84/68 (test-only change, zero Qt files touched)vite buildcleanAdditional Context
Part of the Qt-removal parity/cutover phase (R7). R7.1 (prereq fixes, #139) and R7.2 (relocate 33 survivor modules, #140) are merged; this is R7.3. Next up: R7.4 (build the deferred Ollama/Llama.cpp/API-provider settings pages).