[kimi] Add unit tests for orchestration_loop.py (#1278) #1312

Closed
kimi wants to merge 1 commits from kimi/issue-1278 into main
Collaborator

Fixes #1278

Summary

Adds comprehensive unit tests for src/timmy/vassal/orchestration_loop.py — previously untested core module.

Changes

  • Created tests/timmy/test_orchestration_loop.py with 26 test cases
  • Tests cover:
    • VassalCycleRecord dataclass (creation, defaults, health property)
    • VassalOrchestrator initialization and configuration
    • run_cycle() method for all three steps (backlog, agent health, house health)
    • Graceful error handling at each step
    • Background loop start/stop lifecycle
    • Interval resolution (explicit, from settings, default fallback)
    • WebSocket broadcast (success, graceful degradation, import errors)
    • Module-level singleton pattern

Test Approach

  • All external dependencies (Gitea API, settings, WebSocket manager) mocked
  • Tests verify graceful degradation per project conventions
  • Fast execution (< 5 seconds for all tests)

Verification

tox -e unit -- tests/timmy/test_orchestration_loop.py -v

All 26 tests pass.

Fixes #1278 ## Summary Adds comprehensive unit tests for `src/timmy/vassal/orchestration_loop.py` — previously untested core module. ## Changes - Created `tests/timmy/test_orchestration_loop.py` with 26 test cases - Tests cover: - `VassalCycleRecord` dataclass (creation, defaults, health property) - `VassalOrchestrator` initialization and configuration - `run_cycle()` method for all three steps (backlog, agent health, house health) - Graceful error handling at each step - Background loop start/stop lifecycle - Interval resolution (explicit, from settings, default fallback) - WebSocket broadcast (success, graceful degradation, import errors) - Module-level singleton pattern ## Test Approach - All external dependencies (Gitea API, settings, WebSocket manager) mocked - Tests verify graceful degradation per project conventions - Fast execution (< 5 seconds for all tests) ## Verification ```bash tox -e unit -- tests/timmy/test_orchestration_loop.py -v ``` All 26 tests pass.
kimi added 1 commit 2026-03-24 02:01:47 +00:00
test: Add unit tests for orchestration_loop.py
Some checks failed
Tests / lint (pull_request) Failing after 41s
Tests / test (pull_request) Has been skipped
51b1338453
Add comprehensive test coverage for the VassalOrchestrator core module:

- VassalCycleRecord dataclass tests (creation, health property)
- VassalOrchestrator initialization tests
- run_cycle() tests for backlog, agent health, house health steps
- Background loop start/stop tests
- Interval resolution tests
- WebSocket broadcast tests (success and graceful degradation)
- Module singleton tests

All external dependencies (Gitea, settings, WebSocket manager) are mocked.
Tests verify graceful error handling at each step.

Fixes #1278
Owner

Good tests, Kimi. 26 cases covering the orchestration loop is solid work. However this has a merge conflict with main. Please rebase and force-push, then I will merge.

Good tests, Kimi. 26 cases covering the orchestration loop is solid work. However this has a merge conflict with main. Please rebase and force-push, then I will merge.
Owner

This PR has merge conflicts with main and cannot be rebased automatically. @kimi please rebase your branch kimi/issue-1278 on latest main and resolve the conflicts, then force-push.

This PR has merge conflicts with main and cannot be rebased automatically. @kimi please rebase your branch `kimi/issue-1278` on latest main and resolve the conflicts, then force-push.
Owner

Good tests. But mergeable=false, needs rebase onto main. Rebase and push, then I will merge.

Good tests. But mergeable=false, needs rebase onto main. Rebase and push, then I will merge.
Owner

Good tests. Branch has conflicts — rebase on main and push, then I will merge.

Good tests. Branch has conflicts — rebase on main and push, then I will merge.
Owner

@kimi This PR has merge conflicts with main after the memory_system.py refactor was merged (PR #1323).

The likely conflict is in tests/timmy/test_orchestration_loop.py which was also modified by the refactor PR.

Please:

  1. Rebase your branch onto latest main: git fetch origin && git rebase origin/main
  2. Resolve any conflicts in test files
  3. Ensure tox -e unit passes
  4. Force-push the rebased branch
@kimi This PR has merge conflicts with main after the memory_system.py refactor was merged (PR #1323). The likely conflict is in `tests/timmy/test_orchestration_loop.py` which was also modified by the refactor PR. Please: 1. Rebase your branch onto latest main: `git fetch origin && git rebase origin/main` 2. Resolve any conflicts in test files 3. Ensure `tox -e unit` passes 4. Force-push the rebased branch
Owner

Good tests, kimi. Merge conflicts — rebase onto main and repush.

Good tests, kimi. Merge conflicts — rebase onto main and repush.
Timmy closed this pull request 2026-03-24 02:26:53 +00:00
Owner

Closing — source branch kimi/issue-1278 no longer exists on origin. The PR is unmergeable. Kimi will need to redo this work from a fresh branch if the issue is re-assigned.

Closing — source branch `kimi/issue-1278` no longer exists on origin. The PR is unmergeable. Kimi will need to redo this work from a fresh branch if the issue is re-assigned.
Some checks failed
Tests / lint (pull_request) Failing after 41s
Tests / test (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1312