Skip to content

chore: test coverage analysis + gitignore coverage artefacts#2

Draft
jamestyhurst wants to merge 8 commits into
mainfrom
claude/test-coverage-analysis-ce2ozk
Draft

chore: test coverage analysis + gitignore coverage artefacts#2
jamestyhurst wants to merge 8 commits into
mainfrom
claude/test-coverage-analysis-ce2ozk

Conversation

@jamestyhurst

Copy link
Copy Markdown
Owner

Summary

  • Ran the full pytest suite (133 tests) under pytest-cov to produce a coverage baseline
  • Added .coverage, .coverage.*, htmlcov/, and .pytest_cache/ to .gitignore so coverage artefacts are never accidentally committed
  • Produced a prioritised gap report (conversation-only; no new tests written this session)

Coverage findings (45% overall)

Priority 1 — zero coverage on core modules

  • commentary.py (0%, 99 stmts) — narration style logic; highest-value gap
  • renderers.py (18%, 51 stmts) — output format conversion

Priority 2 — low coverage on high-complexity modules

  • analyzer.py (40%, 518 stmts) — lines 680–1031 (Stockfish integration) completely dark
  • knowledge.py (46%, 451 stmts) — retrieval/ranking logic untested
  • web/pipeline.py (45%, 55 stmts)
  • scripts/bump_version.py (43%, 94 stmts)

Priority 3 — moderate gaps

  • narrator.py (58%), importers.py (60%), outputs.py (64%), web/routers/analysis.py (73%)

Legitimately untested (no action needed): gui.py, main.py, tts.py, scripts/ship.py, tools/*

Build exclusion audit

  • .exe: dev directories (tests/, scripts/, .github/) are not bundled — PyInstaller only follows imports from gui.py. tools.find_games is correctly included via --hidden-import as it provides the user-facing "find similar games" feature.
  • Greco Web: no deployment config exists yet; exclusion list documented for when a Dockerfile/cloud config is created.

Test plan

  • Verify 133 tests still pass on this branch (python -m pytest tests/)
  • Confirm .coverage no longer appears in git status after a coverage run

Generated by Claude Code

claude added 8 commits June 17, 2026 01:54
…local variable

The f-string used html.escape() while assigning to a variable also named
'html'. Python 3.11 raises UnboundLocalError because it correctly treats
the assignment target as a local before the f-string evaluates. Fix: extract
the escaped title into page_title before building the f-string, and rename
the output string to html_doc.

test: test_outputs_assembly.py — assemble_report and markdown_to_html (found the bug)
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.

2 participants