Testing
Testing
Test your agent thoroughly before production. Use local testing, swaig-test CLI, and test calls.
Testing Stages
1. Local Testing
- Run agent locally
- Test with swaig-test CLI
- Verify SWML output
2. Tunnel Testing
- Expose via ngrok
- Make real calls
- Test end-to-end
3. Production Testing
- Deploy to production server
- Test with real phone
- Monitor call logs
swaig-test CLI
Test agents without making calls:
Local Server Testing
Run your agent locally:
Using ngrok
Expose local server for real calls:
Copy the ngrok HTTPS URL and configure in SignalWire.
Test Call Checklist
Basic Functionality
- Call connects successfully
- Agent greeting plays
- Speech recognition works
- Agent responds appropriately
Function Calls
- Functions execute correctly
- Results returned to AI
- AI summarizes results properly
Edge Cases
- Silence handling
- Interruption handling
- Long responses
- Multiple function calls
Error Handling
- Invalid input handled
- Function errors handled gracefully
- Timeout behavior correct
Viewing Logs
In SignalWire dashboard:
- Go to Logs
- Find your test call
- View details:
- Call duration
- SWML executed
- Function calls
- Errors
Debugging with Logs
Add logging to your agent:
Testing Transfers
Test call transfers carefully:
Testing SMS
Test SMS sending:
Load Testing
For production readiness:
- Test concurrent call handling
- Monitor server resources
- Check response times under load
- Verify function execution at scale
- Test database/API connection pooling
Common Test Scenarios
Automated Testing
Create test scripts: