Overview
PentAGI includes three specialized testing tools for different components:- ctester - Provider compatibility testing for LLM providers
- etester - Embedding provider and vector database testing
- ftester - Function and tool testing for agent capabilities
/opt/pentagi/bin/.
Testing Tools
ctester - Compatibility Tester
Tests LLM provider compatibility and performance across different agent types. Location:backend/cmd/ctester
Features
- Tests multiple LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Ollama, Custom)
- Evaluates agent-specific models for different roles
- Supports parallel testing with configurable workers
- Tests basic and advanced capabilities
- Validates JSON output, streaming, and reasoning features
- Generates comprehensive test reports
Usage
Command-Line Options
| Flag | Default | Description |
|---|---|---|
-env | .env | Path to environment file |
-type | custom | Provider type: custom, openai, anthropic, gemini, bedrock, ollama |
-name | Provider name for config lookup | |
-config | Path to provider config YAML file | |
-tests | Path to custom tests YAML file | |
-report | Path to write report file | |
-agents | all | Comma-separated agent types to test |
-groups | all | Test groups: basic, advanced, json, knowledge |
-workers | 4 | Number of parallel workers |
-verbose | false | Enable verbose output |
Supported Agent Types
ctester can test the following agent types:simple- Simple conversation agentsimple_json- JSON-structured response agentprimary_agent- Main orchestration agentassistant- User-facing assistant agentgenerator- Content generation agentrefiner- Response refinement agentadviser- Strategic advice agentreflector- Self-reflection agentsearcher- Information search agentenricher- Context enrichment agentcoder- Code generation agentinstaller- Tool installation agentpentester- Penetration testing agent
Test Groups
Tests are organized into four groups:- Basic - Fundamental capabilities (text generation, reasoning)
- Advanced - Complex multi-step tasks
- JSON - Structured output validation
- Knowledge - Domain-specific understanding
Example Output
etester - Embedding Tester
Tests embedding providers and pgvector database functionality. Location:backend/cmd/etester
Features
- Tests embedding provider connectivity
- Validates pgvector extension setup
- Database statistics and health checks
- Document search and similarity testing
- Batch reindexing capabilities
- Database flush operations
Usage
Commands
| Command | Description |
|---|---|
test | Test embedding provider and pgvector connection |
info | Display statistics about the embedding database |
flush | Delete all documents from the embedding database |
reindex | Recalculate embeddings for all documents |
search | Search for documents in the embedding database |
Command-Line Options
| Flag | Default | Description |
|---|---|---|
-env | .env | Path to environment file |
-verbose | false | Enable verbose output |
-help | false | Show help information |
Example Output
ftester - Function Tester
Tests agent functions and tool capabilities in realistic scenarios. Location:backend/cmd/ftester
Features
- Tests agent tool functions
- Validates Docker integration
- Tests database operations
- Supports mock mode for development
- Provider-specific testing
- Integration with observability stack
Usage
Command-Line Options
| Flag | Default | Description |
|---|---|---|
-env | .env | Path to environment file |
-provider | custom | Provider name: openai, anthropic, gemini, bedrock, ollama, custom |
-flow | 0 | Flow ID for testing (0 = mock mode) |
-user | 0 | User ID (1 = default admin) |
-task | 0 | Task ID (0 = unset) |
-subtask | 0 | Subtask ID (0 = unset) |
Example Output
Running Unit Tests
PentAGI includes unit tests for both backend and frontend.Backend Unit Tests
The backend uses Go’s built-in testing framework.Frontend Unit Tests
The frontend uses Vitest for unit testing.Integration Testing
For end-to-end integration testing:Continuous Integration
PentAGI uses GitHub Actions for CI/CD. The workflow:-
Lint & Format Check
- Backend:
golangci-lint - Frontend:
eslintandprettier
- Backend:
-
Unit Tests
- Backend:
go test - Frontend:
npm test
- Backend:
-
Build Verification
- Backend binaries
- Frontend production build
- Docker image build
-
Integration Tests
- Provider compatibility (ctester)
- Embedding tests (etester)
- Function tests (ftester)
Test Best Practices
Write Tests First
Use TDD approach for new features. Write tests before implementation.
Mock External Services
Use mocks for LLM providers, databases, and external APIs in unit tests.
Test Edge Cases
Include tests for error conditions, timeouts, and invalid inputs.
Keep Tests Fast
Unit tests should run in milliseconds. Use integration tests for slow operations.
Troubleshooting Tests
Tests timing out
Tests timing out
Database connection errors
Database connection errors
Provider API errors
Provider API errors
Docker socket errors
Docker socket errors