Skip to content

test: assert Cache Read column in _render_model_table tests (#1196)#1198

Open
microsasa wants to merge 1 commit intomainfrom
fix/1196-cache-read-column-assertions-c947f8be64158d72
Open

test: assert Cache Read column in _render_model_table tests (#1196)#1198
microsasa wants to merge 1 commit intomainfrom
fix/1196-cache-read-column-assertions-c947f8be64158d72

Conversation

@microsasa
Copy link
Copy Markdown
Owner

Summary

TestRenderModelTable only asserted the Cache Write column but never verified that the Cache Read column header and formatted values appear in _render_model_table output.

Changes

  • test_cache_write_column_present — now also asserts "Cache Read" in output and "8.0K" in output (the fixture already sets cacheReadTokens=8_000)
  • test_cache_read_column_present (new) — dedicated test with cacheReadTokens=8_000, asserts header and "8.0K"
  • test_cache_read_zero_renders (new) — verifies the column header still appears when cacheReadTokens=0 and that "0" is rendered

These additions ensure any regression that drops or silently zeroes the Cache Read column will be caught.

Closes #1196

Warning

⚠️ Firewall blocked 2 domains

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

  • astral.sh
  • pypi.org

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

network:
  allowed:
    - defaults
    - "astral.sh"
    - "pypi.org"

See Network Configuration for more information.

Generated by Issue Implementer · ● 8.3M ·

Add test_cache_read_column_present and test_cache_read_zero_renders to
TestRenderModelTable. Also update test_cache_write_column_present to
assert Cache Read header and 8.0K value (the fixture already sets
cacheReadTokens=8_000).

Closes #1196

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 07:23
@microsasa microsasa added the aw Created by agentic workflow label May 6, 2026
@microsasa microsasa enabled auto-merge May 6, 2026 07:23
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

This PR strengthens copilot_usage.report._render_model_table test coverage by ensuring the Cache Read column header and its formatted values are asserted, preventing regressions where the column is dropped or rendered incorrectly.

Changes:

  • Extends the existing Cache Write test to also assert Cache Read header and value formatting (8.0K).
  • Adds a dedicated test asserting Cache Read renders and formats correctly when non-zero.
  • Adds a test intended to verify Cache Read still renders when the value is zero.

Comment on lines +3560 to +3574
usage=TokenUsage(
inputTokens=100,
outputTokens=50,
cacheReadTokens=0,
cacheWriteTokens=0,
),
)
},
)
buf = StringIO()
console = Console(file=buf, force_terminal=True, width=200)
_render_model_table(console, [session])
output = buf.getvalue()
assert "Cache Read" in output
assert "0" in output
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

Development

Successfully merging this pull request may close these issues.

[aw][test audit] _render_model_table: "Cache Read" column header and value never asserted

2 participants