[P1] Add Test Coverage for Commands and API #9
Labels
No labels
audit-2025-12-03
component/api
component/commands
component/llm
component/memory
component/tick-loop
component/tools
priority
high
priority
low
status
in-progress
status
needs-info
status
needs-triage
status
on-hold
type
bug
type
documentation
type
enhancement
type
feature
type
refactor
type
test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
blightbow/evennia_ai#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Test coverage gaps in specific areas:
API ViewsCounter-Audit (2025-12-05)
The original audit claimed 0% API coverage, but this was inaccurate:
test_api.py- Core assistant endpointstest_api_workbench.py- Prompt workbenchtest_api_tools.py- Tool listingtest_api_templates.py- Template CRUDtest_api_execution_patterns.py- Execution configtest_api_sleep.py- Sleep mode controltest_api_delegation.py- Delegation statusEvennia provides excellent API testing infrastructure via:
BaseEvenniaTest- Test database with accounts, characters, roomsAPIClient- HTTP method testing@override_settings(ROOT_URLCONF=...)- URL routingRemaining Focus Areas
Priority
P1 — High Priority
Source
Architecture Audit 2025-12-03, Critical Gaps Section 1 (updated with counter-audit)
Progress Update: Command Tests Added
Commit
a32c722feadds 31 happy-path tests for AI commands using real assistants.Test Coverage Added
Bugs Fixed During Testing
history.py:
/clear/conversationshowed history instead of clearing/conversationwas checked before/cleargoals.py: Commands failed with assistant key parsing
self.lhscontains entire args when no=delimiter; fixed to extract first wordInfrastructure
eventsourcing_djangotoINSTALLED_APPS(optional dependency pattern)Updated Status
Remaining work: edge cases, error handling, remaining switches.
Progress Update: Command Switch Tests Added
Commit
1ffcc6b12: Add 37 command switch tests and fix messaging bugNew Test Classes (37 tests total)
CmdAIGoal (11 tests)
TestCmdAIGoal_UpdateWithAssistant: /update status, nonexistent goal, invalid status, missing argsTestCmdAIGoal_ProgressWithAssistant: /progress percent, nonexistent goal, invalid number, missing argsTestCmdAIGoal_AbandonWithAssistant: /abandon goal, nonexistent goal, missing argsCmdAIMemory (8 tests)
TestCmdAIMemory_StatusWithAssistant: /status shows client infoTestCmdAIMemory_SearchValidation: /search validation (without args, without query, with query)TestCmdAIMemory_AddValidation: /add validation (without args, without content, short content, valid content)CmdExecution (7 tests)
TestCmdExecution_ToolsWithAssistant: /tools categories, safe_chain, dangerous, invalid categoryTestCmdExecution_DelegationWithAssistant: /delegation status, personality mode, budgetCmdAssistant (11 tests)
TestCmdAssistant_EventsWithAssistant: /events (no pending, with pending)TestCmdAssistant_RAGWithAssistant: /rag (status, config, invalid subcommand)TestCmdAssistant_MessagingWithAssistant: /messaging (config, buffer size, addressing, invalid key, invalid subcommand)Bug Fix
Fixed missing
messaginginMULTI_ARG_SWITCHES(commands/setup/base.py:145). Without this,/messaging testbot set ...parsed the entire argument string as the assistant key.Test Count
Resolution Summary
Tools Coverage - Resolved ✅
Added comprehensive tests for 8 tool modules (91 new tests):
test_tools_delegation.pytest_tools_memory.pytest_tools_sleep.pyTools coverage improved from 11% (2/16) to 56% (9/16).
API Coverage - Already Complete ✅
Counter-audit confirmed 184 existing test methods across 7 files.
Remaining Areas (tracked separately)
ethereal-inventing-raven.mdfor future implementationCommits
88a54c739- Add 91 tests for delegation, memory, and sleep toolsde60c246d- Add WaitTool for skipping ticks without memory consolidation