@gc-mcp/testorchestrator
v1.0.4
Published
MCP Server for Smart Test Orchestration - intelligently determines what tests to run based on changes
Maintainers
Readme
Smart Test Orchestrator MCP Server
An intelligent MCP server that determines what tests to run based on code changes, reducing test execution time by 70%+ while maintaining high confidence levels.
Features
- Intelligent Test Selection: Automatically determines which tests to run based on code changes
- Test Optimization: Optimizes test execution order and parallelization
- Failure Prediction: Predicts which tests are likely to fail based on historical data
- Coverage Analysis: Identifies gaps in test coverage for changed code
- Resource Optimization: Efficiently uses testing resources and constraints
MCP Tools
1. determine_test_scope
Intelligently determine what tests to run based on code changes.
Parameters:
changes: Array of code changes to analyzecontext: Development context (task type, affected services, environment)constraints: Optional execution constraints (time, resources, confidence)
2. optimize_test_execution
Optimize test execution order and parallelization.
Parameters:
test_plan: Test plan from determine_test_scopeoptimization_goals: Goals for optimization (minimize time, maximize confidence, etc.)execution_constraints: Resource and execution constraints
3. predict_test_failures
Predict which tests are likely to fail based on changes and historical data.
Parameters:
changes: Array of code changes to analyzetest_history: Historical test execution dataconfidence_threshold: Threshold for prediction confidencefailure_patterns: Known failure patterns to check
4. suggest_test_data_setup
Suggest optimal test data setup based on changes.
Parameters:
changes: Array of code changes to analyzetest_plan: Test plan to optimize data fordata_constraints: Data size, retention, and privacy requirements
5. analyze_test_coverage_gaps
Analyze gaps in test coverage for changed code.
Parameters:
changes: Array of code changes to analyzecurrent_coverage: Current test coverage datacoverage_threshold: Target coverage thresholdfocus_areas: Specific areas to focus analysis on
Installation
npm installDevelopment
# Install dependencies
npm install
# Build the project
npm run build
# Run tests
npm test
# Run in development mode
npm run devDocker
# Build Docker image
npm run docker:build
# Run with Docker
npm run docker:run
# Test Docker functionality
npm run docker:test
# Stop Docker container
npm run docker:stopConfiguration
Set the following environment variables:
# Test Configuration
TEST_OPTIMIZATION_GOALS=minimize_time,maximize_confidence
MAX_PARALLEL_TESTS=4
TEST_CONFIDENCE_THRESHOLD=0.8
# Resource Constraints
MAX_EXECUTION_TIME=300
MAX_MEMORY_USAGE=8192
CPU_CORES=4
# Failure Prediction
ENABLE_FAILURE_PREDICTION=true
HISTORICAL_DATA_RETENTION_DAYS=30
PATTERN_SIMILARITY_THRESHOLD=0.7Usage
As MCP Server
The server can be used with any MCP-compatible client:
# Start the server
node dist/index.js
# Or use the binary
./bin/mcp-test-orchestratorWith Cursor
Add to your Cursor MCP configuration:
{
"mcpServers": {
"smart-test-orchestrator": {
"command": "node",
"args": ["/path/to/smart-test-orchestrator/dist/index.js"]
}
}
}Architecture
Core Components
- Test Impact Analyzer: Analyzes test impact based on code changes
- Test Selector: Selects optimal tests based on impact and constraints
- Test Optimization Engine: Optimizes test execution order and parallelization
- Failure Predictor: Predicts test failures based on historical data
Data Flow
- Input: Code changes and context
- Analysis: Test impact analysis and risk assessment
- Selection: Optimal test selection based on constraints
- Optimization: Test execution optimization and parallelization
- Output: Optimized test plan with execution strategy
Testing
# Run unit tests
npm test
# Run end-to-end tests
npm run test:e2e
# Run linting
npm run lint
# Type checking
npm run typecheckPerformance
- Time Reduction: 70%+ reduction in test execution time
- Accuracy: 95%+ correct test selection
- Confidence: 90%+ confidence in test coverage
- Resource Efficiency: 80%+ resource utilization
License
MIT
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
Support
For issues and questions, please open an issue on GitHub.
