๐งช MCP ADR Analysis Server Testing Guide
Comprehensive testing guide for developers and contributors
Version: 2.14.12 | Test Files: 70+ | Coverage: 100% (1,739 tests passing)
๐ Table of Contentsโ
- Testing Overview
- Test Suite Structure
- Running Tests
- Test Categories
- Writing New Tests
- CI/CD Integration
- Troubleshooting Tests
- Performance Testing
๐ฏ Testing Overviewโ
The MCP ADR Analysis Server has a comprehensive test suite with 1,739 passing tests across 70+ test files, achieving 100% test success rate. Our testing strategy follows methodological pragmatism principles with systematic verification and explicit acknowledgment of test coverage.
Test Statisticsโ
- Total Tests: 1,739 passing
- Test Suites: 66 suites
- Test Files: 70+ files
- Coverage: >80% target achieved
- Execution Time: ~34 seconds
- Success Rate: 100%
Testing Philosophyโ
- Methodological Pragmatism: Evidence-based testing with confidence scoring
- Integration-Focused: Real-world scenario testing over unit isolation
- Quality Gates: Zero-tolerance for failing tests in production
- Continuous Validation: Automated testing in CI/CD pipeline
๐ Test Suite Structureโ
Core Test Categoriesโ
tests/
โโโ ๐ Core Framework Tests
โ โโโ ape.test.ts # APE framework testing
โ โโโ cache.test.ts # Caching system tests
โ โโโ config.test.ts # Configuration validation
โ โโโ index.test.ts # Main server tests
โ โโโ knowledge-generation.test.ts # AI knowledge generation
โ โโโ mcp-server.test.ts # MCP protocol tests
โ โโโ reflexion.test.ts # Reflexion framework
โ โโโ types.test.ts # Type system validation
โ
โโโ ๐ ๏ธ Tool Tests (18 core tools)
โ โโโ adr-bootstrap-validation-tool.test.ts
โ โโโ adr-suggestion-tool.test.ts
โ โโโ content-masking-tool.test.ts
โ โโโ deployment-analysis-tool.test.ts
โ โโโ deployment-guidance-tool.test.ts
โ โโโ deployment-readiness-tool.test.ts
โ โโโ environment-analysis-tool.test.ts
โ โโโ interactive-adr-planning-tool.test.ts
โ โโโ mcp-planning-tool.test.ts
โ โโโ memory-loading-tool.test.ts
โ โโโ research-integration-tool.test.ts
โ โโโ review-existing-adrs-tool.test.ts
โ โโโ rule-generation-tool.test.ts
โ โโโ smart-git-push-tool-v2.test.ts
โ โโโ smart-git-push-tool.test.ts
โ โโโ tool-chain-orchestrator.test.ts
โ โโโ troubleshoot-guided-workflow-tool.test.ts
โ
โโโ ๐ง Utility Tests
โ โโโ ai-executor.test.ts
โ โโโ deployment-analysis.test.ts
โ โโโ gitleaks-detector.test.ts
โ โโโ interactive-approval.test.ts
โ โโโ location-filter.test.ts
โ โโโ mcp-response-validator.test.ts
โ โโโ memory-entity-manager.test.ts
โ โโโ memory-relationship-mapper.test.ts
โ โโโ memory-rollback-manager.test.ts
โ โโโ memory-transformation.test.ts
โ โโโ output-masking.test.ts
โ โโโ prompt-composition.test.ts
โ โโโ prompt-execution.test.ts
โ โโโ release-readiness-detector.test.ts
โ โโโ research-integration.test.ts
โ โโโ research-questions.test.ts
โ โโโ rule-format.test.ts
โ โโโ rule-generation.test.ts
โ โโโ test-helpers.test.ts
โ โโโ test-infrastructure.test.ts
โ โโโ todo-file-watcher.test.ts
โ โโโ tree-sitter-analyzer.test.ts
โ
โโโ ๐ฏ Prompt Tests
โ โโโ deployment-analysis-prompts.test.ts
โ โโโ environment-analysis-prompts.test.ts
โ โโโ research-integration-prompts.test.ts
โ โโโ research-question-prompts.test.ts
โ โโโ rule-generation-prompts.test.ts
โ โโโ security-prompts.test.ts
โ
โโโ ๐๏ธ Integration Tests
โ โโโ memory-migration-integration.test.ts
โ โโโ memory-migration-simple.test.ts
โ โโโ memory-system-integration.test.ts
โ
โโโ โก Performance Tests
โ โโโ memory-performance.test.ts
โ
โโโ ๐ Configuration Tests
โโโ ai-config.test.ts
๐ Running Testsโ
Basic Test Commandsโ
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode (development)
npm run test:watch
# Run specific test file
npm test -- tests/tools/adr-suggestion-tool.test.ts
# Run tests matching pattern
npm test -- --testNamePattern="memory"
# Run tests with verbose output
npm test -- --verbose
Advanced Test Commandsโ
# Run integration tests only
npm run test:integration
# Run unit tests only
npm run test:unit
# Run performance tests
npm run test:performance
# Run advanced prompting tests
npm run test:advanced
# Run smoke tests (quick validation)
npm test -- tests/smoke.test.ts
Make Commandsโ
# Run all tests (same as npm test)
make test
# Run tests with coverage report
make test-coverage
# Run lint and tests together
make check
# Clean and test
make clean test