UNPKG

@re-shell/cli

Version:

Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja

265 lines (264 loc) 7.38 kB
import { EventEmitter } from 'events'; export interface CICDTestConfig { providers: CICDProvider[]; testSuites: TestSuite[]; parallel?: boolean; maxConcurrency?: number; generateConfigs?: boolean; validateConfigs?: boolean; simulateRuns?: boolean; generateReport?: boolean; outputPath?: string; } export interface CICDProvider { name: 'github' | 'gitlab' | 'jenkins' | 'circleci' | 'azure' | 'bitbucket' | 'custom'; config: ProviderConfig; enabled?: boolean; matrix?: TestMatrix; } export interface ProviderConfig { version?: string; triggers?: string[]; environment?: Record<string, string>; secrets?: string[]; artifacts?: ArtifactConfig[]; caching?: CacheConfig; notifications?: NotificationConfig; timeout?: number; } export interface TestMatrix { os?: string[]; nodeVersion?: string[]; packageManager?: string[]; variables?: Record<string, string[]>; } export interface ArtifactConfig { name: string; path: string; retention?: number; condition?: string; } export interface CacheConfig { enabled: boolean; paths?: string[]; key?: string; restoreKeys?: string[]; } export interface NotificationConfig { onSuccess?: boolean; onFailure?: boolean; channels?: string[]; } export interface TestSuite { name: string; description?: string; jobs: CICDJob[]; dependencies?: string[]; condition?: string; timeout?: number; } export interface CICDJob { name: string; description?: string; steps: JobStep[]; environment?: Record<string, string>; services?: ServiceConfig[]; matrix?: TestMatrix; condition?: string; timeout?: number; retries?: number; continueOnError?: boolean; dependencies?: string[]; } export interface JobStep { name: string; type: 'setup' | 'install' | 'test' | 'build' | 'deploy' | 'script' | 'custom'; command?: string; script?: string[]; uses?: string; with?: Record<string, any>; env?: Record<string, string>; condition?: string; timeout?: number; continueOnError?: boolean; } export interface ServiceConfig { name: string; image: string; ports?: number[]; env?: Record<string, string>; volumes?: string[]; } export interface CICDTestResult { provider: string; suite: string; job: string; success: boolean; duration: number; steps: StepResult[]; artifacts: GeneratedArtifact[]; errors: CICDError[]; warnings: string[]; timestamp: Date; } export interface StepResult { name: string; success: boolean; duration: number; output?: string; error?: string; exitCode?: number; } export interface GeneratedArtifact { name: string; path: string; size: number; type: 'config' | 'report' | 'coverage' | 'log' | 'binary'; provider: string; } export interface CICDError { type: 'syntax' | 'validation' | 'execution' | 'timeout' | 'dependency'; message: string; step?: string; line?: number; suggestion?: string; } export interface CICDTestReport { summary: CICDTestSummary; results: CICDTestResult[]; configs: GeneratedConfig[]; analysis: CICDAnalysis; recommendations: string[]; bestPractices: BestPractice[]; timestamp: Date; } export interface CICDTestSummary { totalProviders: number; totalSuites: number; totalJobs: number; totalSteps: number; passed: number; failed: number; warnings: number; duration: number; coverage: number; } export interface GeneratedConfig { provider: string; path: string; content: string; valid: boolean; errors: string[]; warnings: string[]; } export interface CICDAnalysis { compatibility: CompatibilityMatrix; performance: PerformanceAnalysis; reliability: ReliabilityMetrics; security: SecurityAnalysis; optimization: OptimizationSuggestion[]; } export interface CompatibilityMatrix { providers: string[]; features: string[]; support: boolean[][]; gaps: CompatibilityGap[]; } export interface CompatibilityGap { feature: string; providers: string[]; impact: 'low' | 'medium' | 'high'; workaround?: string; } export interface PerformanceAnalysis { averageJobDuration: number; slowestJobs: Array<{ job: string; duration: number; }>; parallelizationOpportunities: string[]; cacheEffectiveness: number; } export interface ReliabilityMetrics { successRate: number; errorRate: number; timeoutRate: number; retryRate: number; flakyTests: string[]; } export interface SecurityAnalysis { secretsExposed: string[]; permissionsIssues: string[]; vulnerabilities: SecurityVulnerability[]; recommendations: string[]; } export interface SecurityVulnerability { type: 'secret' | 'permission' | 'dependency' | 'configuration'; severity: 'low' | 'medium' | 'high' | 'critical'; description: string; location: string; remediation: string; } export interface OptimizationSuggestion { type: 'cache' | 'parallel' | 'dependency' | 'artifact' | 'matrix'; description: string; impact: 'low' | 'medium' | 'high'; implementation: string; estimatedSavings?: string; } export interface BestPractice { category: 'performance' | 'security' | 'maintainability' | 'reliability'; title: string; description: string; implementation: string; providers: string[]; } export declare class CICDPipelineTesting extends EventEmitter { private config; private results; private generatedConfigs; constructor(config: CICDTestConfig); run(): Promise<CICDTestReport>; private setup; private generateConfigurations; private generateProviderConfig; private generateGitHubConfig; private generateGitLabConfig; private generateJenkinsConfig; private generateCircleCIConfig; private generateAzureConfig; private generateBitbucketConfig; private generateCustomConfig; private buildMatrix; private buildGitLabMatrix; private buildCircleCIParameters; private buildAzureMatrix; private buildGitHubServices; private buildGitHubStep; private getConfigPath; private validateConfigurations; private validateConfig; private validateCommonPatterns; private simulateRuns; private simulateJob; private simulateStep; private generateReport; private generateSummary; private analyzeResults; private analyzeCompatibility; private checkFeatureSupport; private analyzePerformance; private identifyParallelizationOpportunities; private calculateCacheEffectiveness; private analyzeReliability; private analyzeSecurity; private generateOptimizations; private generateRecommendations; private generateBestPractices; private saveReport; private formatMarkdownReport; } export declare function createTestSuite(name: string, jobs: CICDJob[], options?: Partial<TestSuite>): TestSuite; export declare function createCICDJob(name: string, steps: JobStep[], options?: Partial<CICDJob>): CICDJob; export declare function createJobStep(name: string, type: JobStep['type'], options?: Partial<JobStep>): JobStep; export declare function testCICDPipelines(config: CICDTestConfig): Promise<CICDTestReport>;