amazon-seller-mcp
Version:
Model Context Protocol (MCP) client for Amazon Selling Partner API
109 lines (108 loc) • 3.14 kB
TypeScript
/**
* Test maintenance utilities for monitoring test health and performance
* Provides tools for identifying problematic tests and tracking test metrics
*/
export interface TestExecutionMetrics {
testName: string;
filePath: string;
duration: number;
status: 'passed' | 'failed' | 'skipped';
timestamp: string;
memoryUsage?: number;
retries?: number;
}
export interface TestHealthReport {
totalTests: number;
slowTests: TestExecutionMetrics[];
failingTests: TestExecutionMetrics[];
flakyTests: TestExecutionMetrics[];
averageExecutionTime: number;
memoryLeaks: TestExecutionMetrics[];
recommendations: string[];
}
export interface TestPerformanceThresholds {
slowTestThreshold: number;
memoryLeakThreshold: number;
flakyTestRetryThreshold: number;
}
/**
* Default performance thresholds for test monitoring
*/
export declare const DEFAULT_THRESHOLDS: TestPerformanceThresholds;
/**
* Test maintenance utility class for monitoring test health
*/
export declare class TestMaintenanceUtility {
private metricsFile;
private thresholds;
constructor(metricsFile?: string, thresholds?: TestPerformanceThresholds);
/**
* Record test execution metrics
*/
recordTestMetrics(metrics: TestExecutionMetrics): void;
/**
* Load existing test metrics from file
*/
private loadMetrics;
/**
* Save test metrics to file
*/
private saveMetrics;
/**
* Generate comprehensive test health report
*/
generateHealthReport(daysSince?: number): TestHealthReport;
/**
* Identify tests that consistently run slower than threshold
*/
private identifySlowTests;
/**
* Identify tests that have failed recently
*/
private identifyFailingTests;
/**
* Identify flaky tests (tests that sometimes pass, sometimes fail)
*/
private identifyFlakyTests;
/**
* Identify tests with potential memory leaks
*/
private identifyMemoryLeaks;
/**
* Group metrics by test identifier
*/
private groupByTest;
/**
* Generate actionable recommendations based on test health analysis
*/
private generateRecommendations;
/**
* Get test execution time trends over time
*/
getExecutionTimeTrends(testName?: string, filePath?: string): {
dates: string[];
durations: number[];
trend: 'improving' | 'degrading' | 'stable';
};
/**
* Export health report to various formats
*/
exportHealthReport(report: TestHealthReport, format?: 'json' | 'markdown' | 'csv'): string;
private exportToMarkdown;
private exportToCsv;
}
/**
* Utility functions for test maintenance
*/
/**
* Create a test maintenance utility instance
*/
export declare function createTestMaintenanceUtility(metricsFile?: string, thresholds?: Partial<TestPerformanceThresholds>): TestMaintenanceUtility;
/**
* Quick health check function for CI/CD integration
*/
export declare function performQuickHealthCheck(): {
healthy: boolean;
issues: string[];
metrics: TestHealthReport;
};