-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Problem
The agent defaulted to older, more fragile testing patterns:
- Used tuple indexing for mock arguments (
call_args[0][0]) instead of the more readable and robust.argsattribute - Used
capsysto capture output instead of utilizing Click's nativeCliRunnerwhich was already present in the test suite fixtures
These patterns are more fragile and harder to maintain than modern alternatives.
Impact
- Tests are more brittle (tuple indexing can break easily)
- Missed opportunity to use existing test infrastructure (CliRunner fixture)
- Required additional iteration to fix fragile patterns after review
Context
This issue was identified during the bugfix session for ambient-code/agentready#306 addressing ambient-code/agentready#302.
It took a secondary review to identify and request fixes for these patterns.
Recommended Solution
The bugfix workflow's /test phase should:
- Instruct the agent to examine existing test patterns in the codebase FIRST
- Add guidance to prefer modern testing APIs (e.g.,
call_args.args[0]overcall_args[0][0]) - Explicitly mention checking for existing test fixtures/helpers (like
CliRunner) - Include a review step: "Do the new tests match the style and patterns of existing tests?"
Consider adding a "Test Pattern Review" section that prompts the agent to:
- Identify what testing frameworks/patterns are already in use
- Use consistent patterns with the existing test suite
- Prefer built-in test utilities over generic ones (e.g., CliRunner vs. capsys for Click apps)
Reference
From PR comment: #42 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels