mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
5a2883a4a0
Agentic Quality Engineering Fleet - AI-driven quality management platform Features: - 16 specialized QE agents for comprehensive testing - AI-powered test generation with 95% coverage targets - O(log n) sublinear algorithms for massive scale - Parallel test execution with intelligent orchestration - Real-time coverage analysis and gap detection - Smart quality gates with ML-driven decisions - Security scanning (SAST, DAST, dependency analysis) - Performance testing with load orchestration - Flaky test detection with automatic stabilization - API contract validation with breaking change detection - Test data generation (10,000+ records/sec) - Production intelligence (convert incidents to tests) - Chaos engineering for resilience testing - MCP integration with Claude Code - Multi-framework support (Jest, Mocha, Cypress, Playwright) Architecture: - TypeScript implementation - MCP (Model Context Protocol) integration - Claude Code agent orchestration - Event-driven agent coordination - Distributed fleet management - Cross-session memory persistence Documentation: - Complete API documentation (TypeDoc) - User guides (Getting Started, MCP Integration, Test Generation, etc.) - Architecture deep-dive - CLI reference - Contributing guidelines - MIT License Tech Stack: - TypeScript 5.3+ - Node.js 18+ - @anthropic-ai/sdk ^0.64.0 - @modelcontextprotocol/sdk ^1.18.2 - Jest for testing - Winston for logging - SQLite for persistence Project Structure: - src/ - Source code (agents, core, MCP, CLI) - tests/ - Comprehensive test suite - docs/ - Complete documentation - .claude/ - Agent definitions and commands - config/ - Configuration files 🤖 Generated with Claude Code https://claude.com/claude-code Co-Authored-By: Claude <noreply@anthropic.com>
93 lines
3.0 KiB
JavaScript
93 lines
3.0 KiB
JavaScript
/**
|
||
* Custom Jest Reporter for Memory Tracking
|
||
* Monitors memory usage during test execution
|
||
*/
|
||
|
||
class MemoryReporter {
|
||
constructor(globalConfig, options) {
|
||
this._globalConfig = globalConfig;
|
||
this._options = options || {};
|
||
this._enabled = this._options.enabled !== false;
|
||
this._memorySnapshots = [];
|
||
}
|
||
|
||
onRunStart() {
|
||
if (!this._enabled) return;
|
||
|
||
this._memorySnapshots = [];
|
||
console.log('\n🔍 Memory Reporter: Starting memory tracking...\n');
|
||
this._recordMemorySnapshot('Test Run Start');
|
||
}
|
||
|
||
onTestStart(test) {
|
||
if (!this._enabled) return;
|
||
|
||
const testName = test.path.split('/').pop();
|
||
this._recordMemorySnapshot(`Test Start: ${testName}`);
|
||
}
|
||
|
||
onTestResult(test, testResult) {
|
||
if (!this._enabled) return;
|
||
|
||
const testName = test.path.split('/').pop();
|
||
this._recordMemorySnapshot(`Test End: ${testName}`);
|
||
|
||
// Check for potential memory leaks in this test
|
||
if (this._memorySnapshots.length >= 2) {
|
||
const previous = this._memorySnapshots[this._memorySnapshots.length - 2];
|
||
const current = this._memorySnapshots[this._memorySnapshots.length - 1];
|
||
const growth = current.heapUsed - previous.heapUsed;
|
||
const growthMB = (growth / 1024 / 1024).toFixed(2);
|
||
|
||
if (growth > 50 * 1024 * 1024) { // 50MB growth
|
||
console.warn(`⚠️ High memory growth detected in ${testName}: +${growthMB}MB`);
|
||
}
|
||
}
|
||
}
|
||
|
||
onRunComplete() {
|
||
if (!this._enabled) return;
|
||
|
||
this._recordMemorySnapshot('Test Run Complete');
|
||
this._printMemorySummary();
|
||
}
|
||
|
||
_recordMemorySnapshot(label) {
|
||
const usage = process.memoryUsage();
|
||
this._memorySnapshots.push({
|
||
label,
|
||
timestamp: Date.now(),
|
||
heapUsed: usage.heapUsed,
|
||
heapTotal: usage.heapTotal,
|
||
external: usage.external,
|
||
rss: usage.rss
|
||
});
|
||
}
|
||
|
||
_printMemorySummary() {
|
||
console.log('\n📊 Memory Usage Summary:\n');
|
||
|
||
const first = this._memorySnapshots[0];
|
||
const last = this._memorySnapshots[this._memorySnapshots.length - 1];
|
||
|
||
const heapGrowth = last.heapUsed - first.heapUsed;
|
||
const heapGrowthMB = (heapGrowth / 1024 / 1024).toFixed(2);
|
||
const peakHeap = Math.max(...this._memorySnapshots.map(s => s.heapUsed));
|
||
const peakHeapMB = (peakHeap / 1024 / 1024).toFixed(2);
|
||
|
||
console.log(` Start Heap: ${(first.heapUsed / 1024 / 1024).toFixed(2)}MB`);
|
||
console.log(` End Heap: ${(last.heapUsed / 1024 / 1024).toFixed(2)}MB`);
|
||
console.log(` Growth: ${heapGrowthMB}MB`);
|
||
console.log(` Peak Heap: ${peakHeapMB}MB`);
|
||
console.log(` Peak RSS: ${(Math.max(...this._memorySnapshots.map(s => s.rss)) / 1024 / 1024).toFixed(2)}MB`);
|
||
|
||
if (heapGrowth > 100 * 1024 * 1024) { // 100MB total growth
|
||
console.warn('\n⚠️ WARNING: Significant memory growth detected during test run!');
|
||
console.warn(' Consider reviewing tests for memory leaks.\n');
|
||
} else {
|
||
console.log('\n✅ Memory usage within acceptable limits.\n');
|
||
}
|
||
}
|
||
}
|
||
|
||
module.exports = MemoryReporter; |