Repository navigation
test(rendering): snapshot Markdown/HTML/plain surfaces (#1181) - #1192
Conversation
Extend tests/unit/rendering/test_output_snapshots.py with a markdown matrix (empty conv, single user/assistant turn, tool-use round-trip, thinking block, attachment, code fence with embedded backticks, JSON payload) and a parallel HTML matrix exercising the same cases through render_conversation_html(). Add tests/unit/cli/test_plain_cli_snapshots.py to pin the contract- shaped output of polylogue --plain list / count / stats and a provider-filtered list, using the corpus_seeded_db fixture so any user-visible drift in rendering of real synthetic conversations triggers a snapshot diff. Ephemeral fields (timestamps, paths, durations, hex hashes) are redacted before comparison via the documented _redact() helper. Both test modules document the "freeze noise" anti-pattern as a rejected case (do not snapshot timestamps, hash prefixes, or process timings). Closes #1181 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
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 (4)
✨ 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 |
Summary
Adds syrupy snapshot coverage for the Markdown renderer, the in-process
HTML renderer, and the plain (
--plain) CLI output surfaces so that anyuser-visible drift in rendered conversation output triggers a snapshot
diff during local verification.
Problem
Per issue #1181, the 2026-05-11 acceptance matrix for #997 asked for
renderer/output stability snapshots, but no PR in the verifiability wave
delivered them. The existing rendering snapshot file pinned only four
HTML cases and
tests/unit/cli/test_json_envelope_contract.pycoversonly JSON envelopes. The Markdown renderer
(
polylogue/rendering/core_markdown.py), the structured-block codepaths in the HTML renderer, and the rich
--plainCLI surfaces wereunprotected against silent drift.
Solution
tests/unit/rendering/test_output_snapshots.py: extended in-placewith a Markdown matrix (empty conversation, single user turn, single
assistant turn, tool-use round-trip, thinking block, attachment,
code-fence with embedded backticks, JSON payload) calling
format_conversation_markdown()directly, plus a parallel HTML matrixexercising the same cases through
render_conversation_html().tests/unit/cli/test_plain_cli_snapshots.py(new): uses thecorpus_seeded_dbfixture (real synthetic pipeline output) and theClick
CliRunnerto pin the column layout, heading shape, and statssummary returned by
polylogue --plain list,--plain count,--plain stats, and a provider-filtered list. Ephemeral content(timestamps, paths, durations, hex hashes) is stripped via a
documented
_redact()helper before snapshot comparison.their docstrings: snapshots pin contract-shaped output, not
wall-clock fields or implementation noise. The fix for a snapshot
diff caused by ephemeral content is to extend the redactor, not to
regenerate the baseline.
Coverage matrix (closes the AC list in #1181):
test_*_markdown_snapshotteststest_html_sanitizer_security.pytests/unit/cli/test_plain_cli_snapshots.pycorpus_seeded_dbfor CLI<5sruntimedevtools verify --quickVerification
Closes #1181