mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
2253d05618
Remove the nested v3/ subdirectory by moving all active source code, tests, configs, and assets directly to the project root. Archive v2/ (dead code, 847MB) to v2-archive.tar.gz. Key changes: - Move v3/src/ → src/, v3/tests/ → tests/, v3/packages/ → packages/ - Move v3/tsconfig.json, v3/vitest.config.ts to root - Merge v3/package.json into root package.json (ESM, scripts, deps, exports) - Merge v3/scripts/ into scripts/, v3/implementation/ into docs/implementation/ - Update all CI workflows to remove "cd v3 &&" and v3/ path prefixes - Fix all init installer path resolution (3-level-up → 2-level-up) - Fix hooks to use "node ./dist/cli/bundle.js" instead of bare "aqe" - Update settings.json ADR/DDD directories to docs/implementation/ - Fix helper scripts (statusline, adr-compliance, ddd-tracker, guidance-hooks) - Update 58 agent definitions: aqe/v3/ → aqe/ memory namespaces - Update 15 guidance shards: v3/src/ → src/ path references - Fix sync interfaces: remove v3/ and v2/ path references - Fix test path calculations (process.cwd() + '..' no longer needed) - Fix flaky perf test threshold (500ms → 1000ms for CI environments) - Fix complexity-analyzer test to match ADR-051 keyword-based eligibility Build passes, 17,901 tests pass, CLI and MCP bundles verified. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
703 lines
23 KiB
TypeScript
703 lines
23 KiB
TypeScript
/**
|
|
* Agentic QE v3 - Consolidated Domain Plugin Tests
|
|
*
|
|
* Uses the parameterized test generator to test all 12 domain plugins
|
|
* with consistent test coverage while reducing code duplication.
|
|
*
|
|
* This file consolidates the common test patterns from individual plugin.test.ts
|
|
* files into a single, maintainable test suite.
|
|
*
|
|
* Test coverage includes:
|
|
* - Metadata (name, version, dependencies)
|
|
* - Lifecycle (initialize, dispose, ready state)
|
|
* - Health tracking (idle status, agent counts)
|
|
* - Task handler registration
|
|
* - API exposure
|
|
* - Integration configuration (MinCut, Consensus defaults)
|
|
*
|
|
* Domain-specific tests remain in individual plugin.test.ts files for now.
|
|
*/
|
|
|
|
import { describe } from 'vitest';
|
|
import {
|
|
generatePluginTests,
|
|
createTaskValidationTests,
|
|
createEventTests,
|
|
} from './plugin-test-generator';
|
|
|
|
// ============================================================================
|
|
// Domain Plugin Imports
|
|
// ============================================================================
|
|
|
|
import {
|
|
CodeIntelligencePlugin,
|
|
createCodeIntelligencePlugin,
|
|
} from '../../../src/domains/code-intelligence/plugin';
|
|
|
|
import {
|
|
TestExecutionPlugin,
|
|
createTestExecutionPlugin,
|
|
} from '../../../src/domains/test-execution/plugin';
|
|
|
|
import {
|
|
SecurityCompliancePlugin,
|
|
createSecurityCompliancePlugin,
|
|
} from '../../../src/domains/security-compliance/plugin';
|
|
|
|
import {
|
|
VisualAccessibilityPlugin,
|
|
createVisualAccessibilityPlugin,
|
|
} from '../../../src/domains/visual-accessibility/plugin';
|
|
|
|
import {
|
|
ChaosResiliencePlugin,
|
|
createChaosResiliencePlugin,
|
|
} from '../../../src/domains/chaos-resilience/plugin';
|
|
|
|
import {
|
|
CoverageAnalysisPlugin,
|
|
createCoverageAnalysisPlugin,
|
|
} from '../../../src/domains/coverage-analysis/plugin';
|
|
|
|
import {
|
|
DefectIntelligencePlugin,
|
|
createDefectIntelligencePlugin,
|
|
} from '../../../src/domains/defect-intelligence/plugin';
|
|
|
|
import {
|
|
LearningOptimizationPlugin,
|
|
createLearningOptimizationPlugin,
|
|
} from '../../../src/domains/learning-optimization/plugin';
|
|
|
|
import {
|
|
TestGenerationPlugin,
|
|
createTestGenerationPlugin,
|
|
} from '../../../src/domains/test-generation/plugin';
|
|
|
|
import {
|
|
QualityAssessmentPlugin,
|
|
createQualityAssessmentPlugin,
|
|
} from '../../../src/domains/quality-assessment/plugin';
|
|
|
|
import {
|
|
ContractTestingPlugin,
|
|
createContractTestingPlugin,
|
|
} from '../../../src/domains/contract-testing/plugin';
|
|
|
|
import {
|
|
RequirementsValidationPlugin,
|
|
createRequirementsValidationPlugin,
|
|
} from '../../../src/domains/requirements-validation/plugin';
|
|
|
|
// ============================================================================
|
|
// Consolidated Plugin Tests
|
|
// ============================================================================
|
|
|
|
describe('All Domain Plugins (Consolidated)', () => {
|
|
// ==========================================================================
|
|
// 1. Code Intelligence Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('code-intelligence', CodeIntelligencePlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: ['index', 'search', 'analyze-impact', 'query-dependencies'],
|
|
factoryFunction: createCodeIntelligencePlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: ['index', 'search', 'analyzeImpact', 'getDependencies', 'getMetrics'],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getKnowledgeGraph',
|
|
'getSemanticAnalyzer',
|
|
'getImpactAnalyzer',
|
|
],
|
|
sampleTasksKey: 'codeIntelligence',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'index', missingField: 'paths', partialPayload: { language: 'typescript' } },
|
|
{ taskType: 'search', missingField: 'query', partialPayload: { limit: 10 } },
|
|
{ taskType: 'analyze-impact', missingField: 'changedFiles', partialPayload: {} },
|
|
{ taskType: 'query-dependencies', missingField: 'file', partialPayload: { depth: 2 } },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'vcs.FileChanged',
|
|
source: 'vcs',
|
|
payload: { file: 'src/service.ts', changeType: 'modified' },
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
knowledgeGraph: {},
|
|
semanticAnalyzer: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 2. Test Execution Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('test-execution', TestExecutionPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: ['test-generation'],
|
|
taskHandlers: ['execute-tests', 'detect-flaky', 'retry-tests'],
|
|
factoryFunction: createTestExecutionPlugin,
|
|
requiresAgentCoordinator: false,
|
|
apiMethods: ['runTests', 'execute', 'executeParallel', 'detectFlaky', 'retry', 'getStats'],
|
|
sampleTasksKey: 'testExecution',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'execute-tests',
|
|
missingField: 'testFiles or framework',
|
|
partialPayload: { parallel: true },
|
|
},
|
|
{
|
|
taskType: 'detect-flaky',
|
|
missingField: 'testFiles',
|
|
partialPayload: { runs: 5, threshold: 0.1 },
|
|
},
|
|
{
|
|
taskType: 'retry-tests',
|
|
missingField: 'runId or failedTests',
|
|
partialPayload: { failedTests: ['test1'], maxRetries: 3 },
|
|
},
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-generation.TestSuiteCreated',
|
|
source: 'test-generation',
|
|
payload: { suiteId: 'suite_123', testCount: 10, sourceFiles: ['src/index.ts'] },
|
|
memoryKey: 'suite-event:suite_123',
|
|
},
|
|
]),
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 3. Security Compliance Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('security-compliance', SecurityCompliancePlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'security-audit',
|
|
'compliance-check',
|
|
'sast-scan',
|
|
'dast-scan',
|
|
'triage-vulnerabilities',
|
|
],
|
|
factoryFunction: createSecurityCompliancePlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'runSecurityAudit',
|
|
'getSecurityPosture',
|
|
'runSASTScan',
|
|
'runDASTScan',
|
|
'triageVulnerabilities',
|
|
'runComplianceCheck',
|
|
'getAvailableStandards',
|
|
],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getSecurityScanner',
|
|
'getSecurityAuditor',
|
|
'getComplianceValidator',
|
|
],
|
|
sampleTasksKey: 'securityCompliance',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'security-audit',
|
|
missingField: 'target',
|
|
partialPayload: { includesDependencies: true },
|
|
},
|
|
{ taskType: 'compliance-check', missingField: 'standardId', partialPayload: {} },
|
|
{ taskType: 'sast-scan', missingField: 'files', partialPayload: {} },
|
|
{ taskType: 'dast-scan', missingField: 'targetUrl', partialPayload: {} },
|
|
{ taskType: 'triage-vulnerabilities', missingField: 'vulnerabilities', partialPayload: {} },
|
|
]),
|
|
factoryConfig: {
|
|
securityScanner: {},
|
|
complianceValidator: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 4. Visual Accessibility Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('visual-accessibility', VisualAccessibilityPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'run-visual-tests',
|
|
'run-accessibility-audit',
|
|
'capture-screenshot',
|
|
'test-responsiveness',
|
|
'validate-wcag',
|
|
],
|
|
factoryFunction: createVisualAccessibilityPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'runVisualTests',
|
|
'runAccessibilityAudit',
|
|
'approveVisualChanges',
|
|
'generateRemediationPlan',
|
|
'getVisualTestingStatus',
|
|
'captureScreenshot',
|
|
'captureElement',
|
|
'auditAccessibility',
|
|
'checkContrast',
|
|
'validateWCAGLevel',
|
|
'checkKeyboardNavigation',
|
|
'testResponsiveness',
|
|
'analyzeBreakpoints',
|
|
'registerWorkflowActions',
|
|
],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getVisualTester',
|
|
'getAccessibilityTester',
|
|
'getResponsiveTester',
|
|
],
|
|
sampleTasksKey: 'visualAccessibility',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'run-visual-tests',
|
|
missingField: 'urls',
|
|
partialPayload: { viewports: [{ width: 1920, height: 1080 }] },
|
|
},
|
|
{
|
|
taskType: 'run-accessibility-audit',
|
|
missingField: 'urls',
|
|
partialPayload: { level: 'AA' },
|
|
},
|
|
{ taskType: 'capture-screenshot', missingField: 'url', partialPayload: {} },
|
|
{ taskType: 'test-responsiveness', missingField: 'url', partialPayload: {} },
|
|
{ taskType: 'validate-wcag', missingField: 'url', partialPayload: { level: 'AA' } },
|
|
]),
|
|
factoryConfig: {
|
|
visualTester: {},
|
|
accessibilityTester: {},
|
|
responsiveTester: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 5. Chaos Resilience Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('chaos-resilience', ChaosResiliencePlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: ['run-experiment', 'run-load-test', 'assess-resilience', 'inject-fault'],
|
|
factoryFunction: createChaosResiliencePlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: ['runExperiment', 'runLoadTest', 'assessResilience', 'getExperimentHistory'],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getChaosEngine',
|
|
'getLoadTester',
|
|
'getResilienceAssessor',
|
|
],
|
|
sampleTasksKey: 'chaosResilience',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'run-experiment', missingField: 'experimentId', partialPayload: {} },
|
|
{ taskType: 'run-load-test', missingField: 'testId', partialPayload: {} },
|
|
{ taskType: 'assess-resilience', missingField: 'services', partialPayload: {} },
|
|
{
|
|
taskType: 'inject-fault',
|
|
missingField: 'faultType or target',
|
|
partialPayload: { target: 'api-service' },
|
|
},
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'ci-cd.DeploymentCompleted',
|
|
source: 'ci-cd',
|
|
payload: { environment: 'staging', version: '1.0.0' },
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
chaosEngine: {},
|
|
loadTester: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 6. Coverage Analysis Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('coverage-analysis', CoverageAnalysisPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: ['test-execution'],
|
|
taskHandlers: ['analyze-coverage', 'detect-gaps', 'calculate-risk'],
|
|
factoryFunction: createCoverageAnalysisPlugin,
|
|
requiresAgentCoordinator: false,
|
|
sampleTasksKey: 'coverageAnalysis',
|
|
customHealthBehavior: {
|
|
initialTotalAgents: 3,
|
|
initialIdleAgents: 3,
|
|
},
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'analyze-coverage',
|
|
missingField: 'coverageData',
|
|
partialPayload: { threshold: 80 },
|
|
},
|
|
{
|
|
taskType: 'detect-gaps',
|
|
missingField: 'coverageData',
|
|
partialPayload: { minCoverage: 80 },
|
|
},
|
|
{
|
|
taskType: 'calculate-risk',
|
|
missingField: 'file or uncoveredLines',
|
|
partialPayload: { uncoveredLines: [1, 2, 3] },
|
|
},
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-execution.TestRunCompleted',
|
|
source: 'test-execution',
|
|
payload: { runId: 'run_123', passed: 95, failed: 5, skipped: 0, duration: 1000 },
|
|
},
|
|
]),
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 7. Defect Intelligence Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('defect-intelligence', DefectIntelligencePlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'predict-defects',
|
|
'analyze-root-cause',
|
|
'analyze-regression-risk',
|
|
'cluster-defects',
|
|
'learn-patterns',
|
|
],
|
|
factoryFunction: createDefectIntelligencePlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'predictDefects',
|
|
'analyzeRootCause',
|
|
'analyzeRegressionRisk',
|
|
'clusterDefects',
|
|
'learnPatterns',
|
|
],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getPredictor',
|
|
'getPatternLearner',
|
|
'getRootCauseAnalyzer',
|
|
],
|
|
sampleTasksKey: 'defectIntelligence',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'predict-defects', missingField: 'files', partialPayload: { threshold: 0.7 } },
|
|
{
|
|
taskType: 'analyze-root-cause',
|
|
missingField: 'defectId',
|
|
partialPayload: { stackTrace: 'Error at line 42' },
|
|
},
|
|
{ taskType: 'cluster-defects', missingField: 'defects', partialPayload: {} },
|
|
{
|
|
taskType: 'analyze-regression-risk',
|
|
missingField: 'changedFiles',
|
|
partialPayload: { baseline: 'v1.0.0' },
|
|
},
|
|
{ taskType: 'learn-patterns', missingField: 'defectHistory', partialPayload: {} },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-execution.FlakyTestDetected',
|
|
source: 'test-execution',
|
|
payload: {
|
|
testId: 'test_123',
|
|
testFile: 'src/service.test.ts',
|
|
failureRate: 0.25,
|
|
pattern: 'timing-dependent',
|
|
},
|
|
memoryKey: 'defect-intelligence:flaky-test:test_123',
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
predictor: { defaultThreshold: 0.8 },
|
|
patternLearner: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 8. Learning Optimization Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('learning-optimization', LearningOptimizationPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'run-learning-cycle',
|
|
'optimize-strategies',
|
|
'share-learnings',
|
|
'learn-pattern',
|
|
'query-knowledge',
|
|
],
|
|
factoryFunction: createLearningOptimizationPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'runLearningCycle',
|
|
'optimizeAllStrategies',
|
|
'shareCrossDomainLearnings',
|
|
'getLearningDashboard',
|
|
'exportModels',
|
|
'importModels',
|
|
'learnPattern',
|
|
'findMatchingPatterns',
|
|
'applyPattern',
|
|
'updatePatternFeedback',
|
|
'getPatternStats',
|
|
'queryKnowledge',
|
|
'transferKnowledge',
|
|
'optimizeStrategy',
|
|
'runABTest',
|
|
'recommendStrategy',
|
|
'evaluateStrategy',
|
|
],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getActiveWorkflows',
|
|
'getLearningService',
|
|
'getTransferService',
|
|
'getOptimizerService',
|
|
'getProductionIntelService',
|
|
],
|
|
sampleTasksKey: 'learningOptimization',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'run-learning-cycle', missingField: 'domain', partialPayload: {} },
|
|
{ taskType: 'learn-pattern', missingField: 'experiences', partialPayload: {} },
|
|
{ taskType: 'query-knowledge', missingField: 'query', partialPayload: {} },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-generation.TestGenerated',
|
|
source: 'test-generation',
|
|
payload: { testId: 'test_123', testFile: 'test.test.ts', testType: 'unit' },
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
learningService: {},
|
|
transferService: {},
|
|
optimizerService: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 9. Test Generation Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('test-generation', TestGenerationPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'generate-tests',
|
|
'generate-tdd-tests',
|
|
'generate-property-tests',
|
|
'generate-test-data',
|
|
],
|
|
factoryFunction: createTestGenerationPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'generateTests',
|
|
'generateTDDTests',
|
|
'generatePropertyTests',
|
|
'generateTestData',
|
|
'learnPatterns',
|
|
],
|
|
internalAccessors: ['getCoordinator', 'getTestGenerator', 'getPatternMatcher'],
|
|
sampleTasksKey: 'testGeneration',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'generate-tests',
|
|
missingField: 'sourceFiles',
|
|
partialPayload: { testType: 'unit', framework: 'vitest' },
|
|
},
|
|
{
|
|
taskType: 'generate-tdd-tests',
|
|
missingField: 'feature or behavior',
|
|
partialPayload: { behavior: 'should work' },
|
|
},
|
|
{ taskType: 'generate-test-data', missingField: 'schema', partialPayload: { count: 10 } },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'coverage-analysis.CoverageGapDetected',
|
|
source: 'coverage-analysis',
|
|
payload: {
|
|
gapId: 'gap_123',
|
|
file: 'src/service.ts',
|
|
uncoveredLines: [10, 11, 12],
|
|
riskScore: 0.8,
|
|
},
|
|
memoryKey: 'test-generation:pending-gaps:gap_123',
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
coordinator: { maxConcurrentTasks: 5 },
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 10. Quality Assessment Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('quality-assessment', QualityAssessmentPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: ['evaluate-gate', 'analyze-quality', 'deployment-advice', 'analyze-complexity'],
|
|
factoryFunction: createQualityAssessmentPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: ['evaluateGate', 'analyzeQuality', 'getDeploymentAdvice', 'analyzeComplexity'],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getQualityGate',
|
|
'getQualityAnalyzer',
|
|
'getDeploymentAdvisor',
|
|
],
|
|
sampleTasksKey: 'qualityAssessment',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{
|
|
taskType: 'evaluate-gate',
|
|
missingField: 'gateName, metrics, or thresholds',
|
|
partialPayload: { metrics: { coverage: 80 }, thresholds: { coverage: { min: 70 } } },
|
|
},
|
|
{
|
|
taskType: 'analyze-quality',
|
|
missingField: 'sourceFiles',
|
|
partialPayload: { includeMetrics: ['coverage'] },
|
|
},
|
|
{
|
|
taskType: 'deployment-advice',
|
|
missingField: 'releaseCandidate or metrics',
|
|
partialPayload: { metrics: { coverage: 90 }, riskTolerance: 'medium' },
|
|
},
|
|
{
|
|
taskType: 'analyze-complexity',
|
|
missingField: 'sourceFiles',
|
|
partialPayload: { metrics: ['cyclomatic'] },
|
|
},
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-execution.TestRunCompleted',
|
|
source: 'test-execution',
|
|
payload: { runId: 'run_123', passed: 95, failed: 5, skipped: 0, duration: 1000 },
|
|
memoryKey: 'quality-assessment:test-results:run_123',
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
coordinator: {},
|
|
qualityGate: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 11. Contract Testing Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('contract-testing', ContractTestingPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: ['validate-contract', 'compare-versions', 'check-compatibility', 'generate-contract'],
|
|
factoryFunction: createContractTestingPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: ['validateContract', 'compareVersions', 'checkCompatibility', 'generateContract'],
|
|
internalAccessors: ['getCoordinator', 'getSchemaValidator', 'getApiCompatibility'],
|
|
sampleTasksKey: 'contractTesting',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'validate-contract', missingField: 'contract', partialPayload: {} },
|
|
{
|
|
taskType: 'compare-versions',
|
|
missingField: 'oldVersion or newVersion',
|
|
partialPayload: { oldVersion: '1.0.0' },
|
|
},
|
|
{
|
|
taskType: 'check-compatibility',
|
|
missingField: 'provider or consumer',
|
|
partialPayload: { consumer: 'frontend' },
|
|
},
|
|
{ taskType: 'generate-contract', missingField: 'serviceSpec', partialPayload: {} },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'api.VersionChanged',
|
|
source: 'api',
|
|
payload: { serviceName: 'user-service', oldVersion: '1.0.0', newVersion: '1.1.0' },
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
schemaValidator: {},
|
|
apiCompatibility: {},
|
|
},
|
|
});
|
|
|
|
// ==========================================================================
|
|
// 12. Requirements Validation Plugin
|
|
// ==========================================================================
|
|
|
|
generatePluginTests('requirements-validation', RequirementsValidationPlugin, {
|
|
expectedVersion: '1.0.0',
|
|
expectedDependencies: [],
|
|
taskHandlers: [
|
|
'validate',
|
|
'generate-scenarios',
|
|
'score-testability',
|
|
'detect-ambiguity',
|
|
'analyze-dependencies',
|
|
],
|
|
factoryFunction: createRequirementsValidationPlugin,
|
|
requiresAgentCoordinator: true,
|
|
apiMethods: [
|
|
'validate',
|
|
'validateAgainstCriteria',
|
|
'detectAmbiguity',
|
|
'analyzeDependencies',
|
|
'scoreRequirement',
|
|
'scoreRequirements',
|
|
'suggestImprovements',
|
|
'meetsThreshold',
|
|
'generateScenarios',
|
|
'generateScenariosWithExamples',
|
|
'toGherkin',
|
|
'parseGherkin',
|
|
'analyzeRequirement',
|
|
'generateTestArtifacts',
|
|
'validateSprintRequirements',
|
|
],
|
|
internalAccessors: [
|
|
'getCoordinator',
|
|
'getValidator',
|
|
'getBDDWriter',
|
|
'getTestabilityScorer',
|
|
'getActiveWorkflows',
|
|
],
|
|
sampleTasksKey: 'requirementsValidation',
|
|
taskValidationTests: createTaskValidationTests([
|
|
{ taskType: 'validate', missingField: 'requirement', partialPayload: {} },
|
|
{ taskType: 'generate-scenarios', missingField: 'requirementId', partialPayload: {} },
|
|
{ taskType: 'score-testability', missingField: 'requirement', partialPayload: {} },
|
|
{ taskType: 'analyze-dependencies', missingField: 'requirements', partialPayload: {} },
|
|
]),
|
|
eventTests: createEventTests([
|
|
{
|
|
eventType: 'test-generation.TestGenerated',
|
|
source: 'test-generation',
|
|
payload: { testId: 'test_123', sourceFile: 'src/feature.ts' },
|
|
memoryKey: 'requirements-validation:test-link:test_123',
|
|
},
|
|
]),
|
|
factoryConfig: {
|
|
validator: {},
|
|
bddWriter: {},
|
|
testabilityScorer: {},
|
|
},
|
|
});
|
|
});
|