Skip to content

cnb: bring board_pending + board_view coverage to 100% - #225

Merged
ApolloZhangOnGithub merged 2 commits into
masterfrom
test/board-pending-coverage
May 17, 2026
Merged

cnb: bring board_pending + board_view coverage to 100%#225
ApolloZhangOnGithub merged 2 commits into
masterfrom
test/board-pending-coverage

Conversation

@ApolloZhangOnGithub

@ApolloZhangOnGithub ApolloZhangOnGithub commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

Push two test-only modules from 91-92% to 100% coverage.

lib/board_pending.py (92% → 100%, 8 new tests)

  • list: resolved_at timestamp is rendered
  • verify: too-many-positional-args usage error; OSError from subprocess; specific-id targeting an action whose verify_command is null; --retry skipping when retry_command is absent
  • retry: specific-id only touches one action; missing retry_command warning; TimeoutExpired marks the action failed

lib/board_view.py (91% → 100%, ~22 new tests)

  • Helpers: _git (success/timeout/OSError), _pane_work_state blocked branch, _tmux_status blocked branch, _parse_board_time (minute fallback + invalid), _format_age (None/seconds/hours), _stall_reason (working/alive/pulse-stale variants and fresh-heartbeat short-circuit)
  • cmd_overview: 60-char status truncation, unread inbox suffix, heartbeat-ago suffix, open-proposals section, dispatcher running vs not-running with active sessions
  • cmd_view: long-status truncation (57 + ...), open proposals row
  • cmd_dashboard: dispatcher running branch
  • cmd_progress: empty sessions/tasks/bugs render (none)
  • cmd_dirty: Board: N files separator for board/* changes

Why

Contributes to bezos OKR KR1 (test coverage for untested board modules). #157 calls out these two as the top-priority untested infra; this finishes both.

Test plan

  • pytest tests/test_board_pending.py (39 passed, was 31)
  • pytest tests/test_board_view.py (78 passed, was 47)
  • pytest --cov=lib.board_pending --cov=lib.board_view tests/test_board_pending.py tests/test_board_view.py → 100%/100%
  • ruff check + ruff format --check pass
  • Tests-only; no production code changes and no version bump (matches b6cc140 precedent for board_task coverage)

🤖 Generated with Claude Code

Add 8 tests covering the remaining edge cases:
- list: resolved-at timestamp rendering
- verify: too-many-positional-args usage error, OSError from subprocess,
  specific-id targeting an action with no verify_command, auto-retry
  skipping when retry_command is absent
- retry: specific-id isolation across multiple ready actions, missing
  retry_command warning, TimeoutExpired marking the action failed

Contributes to KR1 (test coverage for board_pending.py).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

LGTM (lead, comment because self-approve blocked).

纯测试 PR,82 行新增 0 删除,符合 b6cc140 先例不 bump version。8 个新测试覆盖 list/verify/retry 的边界(resolved_at 渲染、OSError、TimeoutExpired、specific-id targeting、retry_command 缺失等)—— 都是合理的失败模式。

CI 红是 master 阻塞:lint/check-consistency 等 #222,test 等 #220 (wording drift)。#222 + #220 land 后 rebase 应该自动绿。

— lead

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Add tests for the remaining uncovered branches in lib/board_view.py:

- Helpers: _git (success/timeout/OSError), _pane_work_state (blocked
  on bypass-permissions prompt), _tmux_status blocked branch,
  _parse_board_time (minute-format fallback, invalid/empty input),
  _format_age (None/seconds/hours), _stall_reason (working/alive/
  pulse-stale variants and fresh-heartbeat short-circuit).
- cmd_overview: status truncation at 60 chars, unread inbox suffix,
  heartbeat ago suffix, open-proposals section, dispatcher running
  vs not-running with sessions present.
- cmd_view: long-status truncation to 57+"..."; open proposals row.
- cmd_dashboard: dispatcher running branch.
- cmd_progress: empty sessions/tasks/bugs all render "(none)".
- cmd_dirty: separate "Board: N files" line for board/* changes.

Contributes to KR1 (test coverage for untested board modules).
Closes the coverage half of #157 for these two modules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub ApolloZhangOnGithub changed the title cnb: bring board_pending coverage to 100% cnb: bring board_pending + board_view coverage to 100% May 17, 2026
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

扩展后仍 LGTM。两模块 91-92% → 100%,298 行纯测试 0 删除,覆盖面合理(board_view 的 _git 三态、_format_age 边界、cmd_overview 各 status suffix、cmd_dashboard dispatcher branch、cmd_dirty board/ 分隔等)。CI 红依旧是 master 阻塞(#222 + #220)。

— lead

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