Skip to content

Test/mg/major refactor#64

Merged
galuszkm merged 3 commits into
mainfrom
test/mg/major-refactor
Jul 1, 2026
Merged

Test/mg/major refactor#64
galuszkm merged 3 commits into
mainfrom
test/mg/major-refactor

Conversation

@galuszkm

@galuszkm galuszkm commented Jul 1, 2026

Copy link
Copy Markdown
Member

Description

Refactors the test suite around a behaviour-driven, slim-by-default strategy and documents it as the project's testing doctrine.

Adds .kiro/skills/library-testing/SKILL.md — the authoritative doctrine that defines what is worth testing, what is not, and how. Establishes the mental model, includes references/test-patterns.md with copy-paste templates.

Implements the doctrine across the full suite:

  • Fakes strands only at owned resolver seams (resolve_model / resolve_mcp_server / resolve_mcp_client) using hand-written FakeModel / FakeMCPServer / FakeMCPClient; all tests are deterministic (no network, no model calls, no MCP subprocesses, no sleeps).
  • Restructures test files to mirror pipeline stages (parse/, schema/, resolve/, runtime/, pipeline/, property/, contract/), weighted toward resolver wiring, with factories.py builders over fixture sprawl.
  • Pins the public StreamEvent / SessionManifest shape with a single reviewed contract snapshot (contract/test_shape.py) instead of scattered event-count assertions.
  • Closes owned-logic gaps: multi-agent result extraction (runtime/test_result_extraction.py), tool-name sanitizer recovery paths (parametrized BeforeToolCallEvent + AfterModelCallEvent Layer-1 test), and the session-manager infra/session split contract (resolve/test_session_manager.py).
  • 221 tests, ~9.4 s, 76% branch coverage, just check clean.

Related Issues

N/A

Type of Change

  • Other: test suite refactor + testing doctrine documentation

YAML / API Impact

None. No changes to the config schema or public Python API.

Testing

How have you tested the change?

  • I ran uv run just check (lint + type check)
  • I ran uv run just test for overall testing
  • I added or updated tests that prove my fix is effective or my feature works
  • I verified existing examples in examples/ still work

Checklist

  • I have read the CONTRIBUTING document
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

galuszkm added 2 commits July 1, 2026 23:47
- fix mutable default arg bug in EventQueue.close()
- replace Iterator with Generator in cli_errors return type
- add .kiro library-development skill with project map reference
- rewrite README and AGENTS.md for clarity
- Establish a thin-translator doctrine: assert on wiring, error types, and
  emitted-event/manifest shape through public seams — never on private members,
  strands/Pydantic internals, mock calls, or message text
- Fake strands only at our own resolver seams (resolve_model / mcp) with
  hand-written fakes and real Agent objects; keep every test deterministic
  (no network, model calls, MCP subprocesses, or sleeps)
- Restructure tests to mirror pipeline stages (parse, schema, resolve, runtime,
  pipeline, property, contract), weighted toward resolver wiring, with builders
  over fixture sprawl
- Pin the public event/manifest shape with a single reviewed contract snapshot
  instead of scattered exact event-count assertions
- Close targeted gaps in owned logic: multi-agent result extraction, tool-name
  sanitizer recovery, and the session-manager infra/session split
Comment thread tests/fakes/strands.py Fixed
Comment thread tests/runtime/test_event_stream.py Fixed
Comment thread tests/runtime/test_event_stream.py Dismissed
@galuszkm galuszkm merged commit e9b6cb4 into main Jul 1, 2026
8 checks passed
@galuszkm galuszkm deleted the test/mg/major-refactor branch July 1, 2026 23:58
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