Skip to content

test: ratchet coverage floor to 87 - #385

Merged
Sinity merged 2 commits into
masterfrom
feature/test/coverage-ratchet-87-cli-site
Apr 23, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/test/coverage-ratchet-87-cli-site

Conversation

@Sinity

@Sinity Sinity commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Raise the coverage floor from 86 to 87 with a focused CLI operator-helper tranche that directly covers the rendering and workflow helpers that were still sitting at 0% or near-0% coverage.

Problem

Ref #197 is now in the part of the climb where the remaining gap is not about broad package averages so much as real blind spots in active control-plane code. Several CLI helper modules in rendering, workflow, and schema/operator surfaces were effectively untested despite being on daily operator paths.

Solution

  • add direct unit tests for:
    • polylogue/cli/products_rendering.py
    • polylogue/cli/products_workflow.py
    • polylogue/cli/run_display_workflow.py
    • polylogue/cli/run_watch_workflow.py
    • polylogue/cli/schema_command_support.py
    • polylogue/cli/schema_rendering_explain.py
    • polylogue/cli/schema_rendering_results.py
    • polylogue/cli/query_verbs.py
  • cover both human and machine-output branches instead of relying on incidental higher-level command coverage
  • raise fail_under from 86 to 87 after the full suite cleared at 87.33%

Targeted module movement from the full coverage run:

  • products_rendering.py: 100%
  • products_workflow.py: 100%
  • query_verbs.py: 100%
  • run_watch_workflow.py: 100%
  • run_display_workflow.py: 92%
  • schema_command_support.py: 96%
  • schema_rendering_explain.py: 92%
  • schema_rendering_results.py: 87%

Verification

  • ruff check tests/unit/cli/test_products_helper_runtime.py tests/unit/cli/test_run_display_workflow_runtime.py tests/unit/cli/test_schema_helper_runtime.py tests/unit/cli/test_query_verbs_runtime.py
  • mypy --strict tests/unit/cli/test_products_helper_runtime.py tests/unit/cli/test_run_display_workflow_runtime.py tests/unit/cli/test_schema_helper_runtime.py tests/unit/cli/test_query_verbs_runtime.py
  • pytest -q tests/unit/cli/test_products_helper_runtime.py tests/unit/cli/test_run_display_workflow_runtime.py tests/unit/cli/test_schema_helper_runtime.py tests/unit/cli/test_query_verbs_runtime.py
  • devtools coverage-gate
    • 5434 passed in 262.51s (0:04:22)
    • Required test coverage of 87% reached. Total coverage: 87.33%
  • devtools verify --quick

Ref #197

Summary by CodeRabbit

  • Tests

    • Added comprehensive unit test modules for CLI product helpers, query verb runtime behavior, display workflow handling, and schema rendering operations.
  • Chores

    • Adjusted code coverage reporting requirements.

Sinity added 2 commits April 23, 2026 14:12
Problem
The next #197 coverage tranche needed to retire some of the worst
remaining blind spots in the CLI control plane. Several operator-facing
helper modules were still at 0% or near-0% coverage despite sitting on
active rendering and workflow paths.

What changed
Add direct unit coverage for product helper surfaces, query verb
adapters, run display/watch helpers, schema privacy-config support, and
schema explain/result renderers. The new tests exercise both machine and
human output paths instead of relying on incidental higher-level command
coverage.

Verification
Focused pytest, strict mypy, and the full coverage gate all passed with
this slice in place.

Ref #197
Problem
#197 still needed the next measured coverage raise after the 86% tranche, but the floor should only move once the full suite clears with the new operator-helper coverage in place.

What changed
Raise the coverage fail_under threshold from 86 to 87.

Verification
devtools coverage-gate passed at 87.33% total coverage with 5434 passing tests, and devtools verify --quick passed afterward.

Ref #197
@Sinity
Sinity merged commit acd5561 into master Apr 23, 2026
11 checks passed
@Sinity
Sinity deleted the feature/test/coverage-ratchet-87-cli-site branch April 23, 2026 12:15
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3f7e0daf-8f4c-4a3c-b5f9-b6c8a20e9e11

📥 Commits

Reviewing files that changed from the base of the PR and between bef537b and b19a65c.

📒 Files selected for processing (5)
  • pyproject.toml
  • tests/unit/cli/test_products_helper_runtime.py
  • tests/unit/cli/test_query_verbs_runtime.py
  • tests/unit/cli/test_run_display_workflow_runtime.py
  • tests/unit/cli/test_schema_helper_runtime.py

📝 Walkthrough

Walkthrough

Coverage minimum threshold increased from 86% to 87% in configuration. Four new CLI unit test modules added covering product helpers, query verbs, run display workflows, and schema helpers with comprehensive runtime behavior validation across approximately 930 lines of test code.

Changes

Cohort / File(s) Summary
Coverage Configuration
pyproject.toml
Bumped [tool.coverage.report].fail_under from 86 to 87 to enforce higher coverage threshold.
CLI Product Helpers Tests
tests/unit/cli/test_products_helper_runtime.py
Added unit tests for model_payload, model_payloads, emit_product_list, summarize_archive_debt, and products_workflow re-export verification with mocked emission and aggregation assertions.
CLI Query Verbs Tests
tests/unit/cli/test_query_verbs_runtime.py
Added unit tests for Click context handling, query term derivation, and wrapper callbacks for list_verb, count_verb, stats_verb, open_verb, and delete_verb with assertion of expected parameter updates.
CLI Run Display Workflow Tests
tests/unit/cli/test_run_display_workflow_runtime.py
Added unit tests for display_result, render_sources, handle_drive_error, render_preview_summary, and watch observers (WatchDisplayObserver, WatchStatusObserver) with fixture-based validation of output payloads and console emissions.
CLI Schema Helper Tests
tests/unit/cli/test_schema_helper_runtime.py
Added unit tests for schema rendering across privacy configuration, explain, generation, listing, compare, promote, and audit workflows with assertions on JSON payloads, markdown output, and console text fragments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Suggested labels

type:refactor, area:qa

Poem

🐰 A hop, skip, and test leap—
Coverage climbs from eighty-six so deep,
Four test suites spring forth with cheer,
Queries, schemas, runs appear,
Eighty-seven percent we keep! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/coverage-ratchet-87-cli-site

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Sinity
Sinity requested review from Copilot and removed request for Copilot May 1, 2026 01:54
Sinity added a commit that referenced this pull request May 7, 2026
## Summary
Raise the coverage floor from 86 to 87 with a focused CLI
operator-helper tranche that directly covers the rendering and workflow
helpers that were still sitting at 0% or near-0% coverage.

## Problem
Ref #197 is now in the part of the climb where the remaining gap is not
about broad package averages so much as real blind spots in active
control-plane code. Several CLI helper modules in rendering, workflow,
and schema/operator surfaces were effectively untested despite being on
daily operator paths.

## Solution
- add direct unit tests for:
  - `polylogue/cli/products_rendering.py`
  - `polylogue/cli/products_workflow.py`
  - `polylogue/cli/run_display_workflow.py`
  - `polylogue/cli/run_watch_workflow.py`
  - `polylogue/cli/schema_command_support.py`
  - `polylogue/cli/schema_rendering_explain.py`
  - `polylogue/cli/schema_rendering_results.py`
  - `polylogue/cli/query_verbs.py`
- cover both human and machine-output branches instead of relying on
incidental higher-level command coverage
- raise `fail_under` from 86 to 87 after the full suite cleared at
87.33%

Targeted module movement from the full coverage run:
- `products_rendering.py`: 100%
- `products_workflow.py`: 100%
- `query_verbs.py`: 100%
- `run_watch_workflow.py`: 100%
- `run_display_workflow.py`: 92%
- `schema_command_support.py`: 96%
- `schema_rendering_explain.py`: 92%
- `schema_rendering_results.py`: 87%

## Verification
- `ruff check tests/unit/cli/test_products_helper_runtime.py
tests/unit/cli/test_run_display_workflow_runtime.py
tests/unit/cli/test_schema_helper_runtime.py
tests/unit/cli/test_query_verbs_runtime.py`
- `mypy --strict tests/unit/cli/test_products_helper_runtime.py
tests/unit/cli/test_run_display_workflow_runtime.py
tests/unit/cli/test_schema_helper_runtime.py
tests/unit/cli/test_query_verbs_runtime.py`
- `pytest -q tests/unit/cli/test_products_helper_runtime.py
tests/unit/cli/test_run_display_workflow_runtime.py
tests/unit/cli/test_schema_helper_runtime.py
tests/unit/cli/test_query_verbs_runtime.py`
- `devtools coverage-gate`
  - `5434 passed in 262.51s (0:04:22)`
  - `Required test coverage of 87% reached. Total coverage: 87.33%`
- `devtools verify --quick`

Ref #197
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