# Testing Guide Comprehensive testing documentation for FetchML platform. ## Quick Start Testing For a fast 5-minute testing experience, see the **[Quick Start Testing Guide](quick-start-testing.md)**. ## Test Types ### Unit Tests ```bash make test-unit # Go unit tests only cd cli && zig build test # Zig CLI tests ``` ### Integration Tests ```bash make test-integration # API and database integration ``` ### End-to-End Tests ```bash make test-e2e # Full workflow testing ``` ### All Tests ```bash make test # Run complete test suite make test-coverage # With coverage report ``` ## Docker Testing ### Development Environment ```bash docker-compose up -d make test docker-compose down ``` ### Production Environment Testing ```bash docker-compose -f docker-compose.prod.yml up -d make test-auth # Multi-user auth test make self-cleanup # Clean up after testing ``` ## Performance Testing ### Benchmark Suite ```bash ./scripts/benchmarks/run-benchmarks-local.sh ``` ### Load Testing ```bash make test-load # API load testing ``` ## Authentication Testing Multi-user authentication testing is fully covered in the **[Quick Start Testing Guide](quick-start-testing.md)**. ```bash make test-auth # Quick auth role testing ``` ## CLI Testing ### Build and Test CLI ```bash cd cli && zig build dev ./cli/zig-out/dev/ml --help zig build test ``` ### CLI Integration Tests ```bash make test-cli # CLI-specific integration tests ``` ## Troubleshooting Tests ### Common Issues - **Server not running**: Check with `docker ps --filter "name=ml-"` - **Authentication failures**: Verify configs in `~/.ml/config-*.toml` - **Connection issues**: Test API with `curl -I http://localhost:9103/health` ### Debug Mode ```bash make test-debug # Run tests with verbose output ``` ## Test Configuration ### Test Configs Location - `~/.ml/config-admin.toml` - Admin user - `~/.ml/config-researcher.toml` - Researcher user - `~/.ml/config-analyst.toml` - Analyst user ### Test Data - `tests/fixtures/` - Test data and examples - `tests/benchmarks/` - Performance test data ## Continuous Integration Tests run automatically on: - Pull requests (full suite) - Main branch commits (unit + integration) - Releases (full suite + benchmarks) ## Writing Tests ### Go Tests - Unit tests: `*_test.go` files - Integration tests: `tests/e2e/` directory - Benchmark tests: `tests/benchmarks/` directory ### Zig Tests - CLI tests: `cli/tests/` directory - Follow Zig testing conventions ## See Also - **[Quick Start Testing Guide](quick-start-testing.md)** - Fast 5-minute testing - **[Testing Protocol](testing-protocol.md)** - Detailed testing procedures - **[Configuration Reference](configuration-reference.md)** - Test setup - **[Troubleshooting](troubleshooting.md)** - Common issues