- Add 5 workflow tests (task, context loading, stop-on-failure, conversational) - Add 1 shared test (agent-agnostic approval gate) - Reorganize: opencode/ → agents/ for clearer structure - Rename: sdk-tests/ → tests/ for simplicity - Update test runner paths to new structure - Add comprehensive documentation (test plan, guides, migration) - Update all documentation with new paths Total: 13 tests (was 6, added 7) Coverage: +31% workflow compliance All tests passing: 11/11 (100%) |
||
|---|---|---|
| .. | ||
| tests/common | ||
| README.md | ||
Shared Test Cases
Tests in this directory are agent-agnostic and can be used to test any agent that follows the same core rules.
Purpose
Shared tests validate universal behaviors that all agents should follow:
- Approval gate enforcement
- Tool usage patterns
- Basic workflow compliance
- Error handling
Usage
Run Shared Tests for OpenAgent
npm run eval:sdk -- --pattern="shared/**/*.yaml" --agent=openagent
Run Shared Tests for OpenCoder
npm run eval:sdk -- --pattern="shared/**/*.yaml" --agent=opencoder
Override Agent in Test File
# In the YAML file
agent: openagent # Change to opencoder, or any other agent
Test Categories
common/ - Universal Rules
Tests that apply to all agents:
approval-gate-basic.yaml- Basic approval enforcementtool-usage-basic.yaml- Basic tool selection (future)error-handling-basic.yaml- Basic error handling (future)
Adding New Shared Tests
- Create test in
shared/tests/common/ - Use generic prompts (not agent-specific)
- Test universal behaviors only
- Tag with
shared-testandagent-agnostic - Document which agents it applies to
Example
id: shared-example-001
name: Example Shared Test
category: edge-case
agent: openagent # Default, can be overridden
prompt: "Generic prompt that works for any agent"
behavior:
requiresApproval: true # Universal rule
expectedViolations:
- rule: approval-gate
shouldViolate: false
tags:
- shared-test
- agent-agnostic
Benefits
- Reduce Duplication - Write once, test multiple agents
- Consistency - Same tests ensure consistent behavior
- Easy Comparison - Compare agent behaviors side-by-side
- Faster Onboarding - New agents inherit core test suite