Skip to content

test: add multi-model pure-active and shutdown_only coverage (#1189)#1193

Open
microsasa wants to merge 1 commit intomainfrom
fix/issue-1189-test-coverage-gaps-a5d4a9644716fefe
Open

test: add multi-model pure-active and shutdown_only coverage (#1189)#1193
microsasa wants to merge 1 commit intomainfrom
fix/issue-1189-test-coverage-gaps-a5d4a9644716fefe

Conversation

@microsasa
Copy link
Copy Markdown
Owner

Closes #1189

Summary

Adds two tests addressing test coverage gaps identified in the issue:

Gap 1 — render_cost_view multi-model pure-active session

test_cost_view_multi_model_pure_active verifies that a pure-active session with two models in model_metrics:

  • Shows '—' in Requests and Premium Cost columns for both model rows
  • Grand total includes output tokens from both models (500 + 300 = 800)
  • Grand total Requests/Premium stay at 0 (no inflation from synthetic zeros)
  • No '↳ Since last shutdown' sub-row appears

Gap 2 — _compute_session_totals pure-active with shutdown_only=True

test_shutdown_only_no_effect_for_pure_active_session verifies that when shutdown_only=True is passed for a pure-active session (has_shutdown_metrics=False):

  • model_calls returns the full total (8, not 8−5=3)
  • user_messages returns the full total (4, not 4−2=2)

The subtraction branch requires has_shutdown_metrics=True, so pure-active sessions should pass through unchanged.

Testing

Both tests follow the exact spec from the issue and are placed in their respective test classes (TestRenderCostViewPureActiveNoShutdownRow and TestComputeSessionTotals).

Warning

⚠️ Firewall blocked 4 domains

The following domains were blocked by the firewall during workflow execution:

  • astral.sh
  • index.crates.io
  • pypi.org
  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "astral.sh"
    - "index.crates.io"
    - "pypi.org"
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by Issue Implementer · ● 13.6M ·

…_only on pure-active sessions

Add two tests addressing coverage gaps identified in #1189:

1. test_cost_view_multi_model_pure_active: verifies that a pure-active
   session with two models shows '—' for both model rows' Requests and
   Premium Cost columns, and that grand totals don't inflate from
   synthetic zeros.

2. test_shutdown_only_no_effect_for_pure_active_session: verifies that
   _compute_session_totals with shutdown_only=True returns full totals
   (not subtracted) for pure-active sessions where has_shutdown_metrics
   is False.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 11:03
@microsasa microsasa added the aw Created by agentic workflow label May 5, 2026
@microsasa microsasa enabled auto-merge May 5, 2026 11:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds targeted regression tests in test_report.py to cover two pure-active session edge cases in reporting logic, strengthening confidence around cost rendering and shutdown-only totals in the CLI reporting layer.

Changes:

  • Added a render_cost_view test for a multi-model pure-active session to verify per-model display, correct grand totals, and absence of the shutdown sub-row.
  • Added a _compute_session_totals(..., shutdown_only=True) test confirming pure-active sessions do not subtract active counters when has_shutdown_metrics=False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aw Created by agentic workflow

Projects

None yet

2 participants