Skip to content

Qt-removal R7.3: port 3 confirmed test-coverage gaps into backend/tests/#141

Merged
dovvnloading merged 1 commit into
mainfrom
qt-removal/r7-3-backend-test-gaps
Jul 26, 2026
Merged

Qt-removal R7.3: port 3 confirmed test-coverage gaps into backend/tests/#141
dovvnloading merged 1 commit into
mainfrom
qt-removal/r7-3-backend-test-gaps

Conversation

@dovvnloading

Copy link
Copy Markdown
Owner

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) that backend/ imports and uses in live production paths, but whose own validation/caching/schema logic had zero backend/tests coverage.

What Changed

  • backend/tests/test_chart_data_validation.py (new, 4 tests) — canonicalize_chart_data's own ChartDataError branch (non-finite numbers, wrong container types, sankey-cycle rejection, duplicate-flow aggregation) and ChartDataAgent.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_version fresh-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/SceneSerializer chat-payload schema versioning) has no backend/ equivalent yet, so porting those would test nothing real.

Why

  • These are live production code paths (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.
  • Every new test was mutation-tested against the actual production code (deliberately breaking the logic under test and confirming the test fails) before being counted as real coverage.

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)
  • Full backend suite: 2387 passed (2375 baseline + 12 new), no regressions
  • Frontend sanity: 1053 vitest passed, vite build clean

Additional 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).

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>
@dovvnloading
dovvnloading merged commit c7fddd2 into main Jul 26, 2026
2 checks passed
@dovvnloading
dovvnloading deleted the qt-removal/r7-3-backend-test-gaps branch July 26, 2026 11:56
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.

1 participant