@debugg-ai/cli
Version:
CLI tool for running DebuggAI tests in CI/CD environments
114 lines • 3.5 kB
TypeScript
import { TunnelInfo } from './tunnel-manager';
export interface TestManagerOptions {
apiKey: string;
repoPath: string;
baseUrl?: string;
testOutputDir?: string;
waitForServer?: boolean;
serverTimeout?: number;
maxTestWaitTime?: number;
tunnelUrl?: string;
tunnelMetadata?: Record<string, any> | undefined;
downloadArtifacts?: boolean;
commit?: string;
commitRange?: string;
since?: string;
last?: number;
pr?: number;
prSequence?: boolean;
baseBranch?: string | undefined;
headBranch?: string | undefined;
tunnelKey?: string;
createTunnel?: boolean;
tunnelPort?: number;
}
export interface TestResult {
success: boolean;
suiteUuid?: string | undefined;
suite?: any;
error?: string;
testFiles?: string[];
tunnelKey?: string;
tunnelInfo?: TunnelInfo;
prSequenceResults?: PRSequenceResult[];
totalCommitsTested?: number;
}
export interface PRSequenceResult {
commitHash: string;
commitMessage: string;
commitOrder: number;
suiteUuid: string;
success: boolean;
error?: string;
testFiles?: string[];
}
/**
* Manages the complete test lifecycle from commit analysis to result reporting
*/
export declare class TestManager {
private client;
private gitAnalyzer;
private tunnelManager?;
private tunnelInfo?;
private options;
constructor(options: TestManagerOptions);
/**
* Create TestManager with tunnel URL support
*/
static withTunnel(options: Omit<TestManagerOptions, 'tunnelUrl' | 'tunnelMetadata'>, tunnelUrl: string, tunnelMetadata?: Record<string, any>): TestManager;
/**
* Create TestManager that will create an ngrok tunnel after backend provides tunnelKey
* This is the correct flow: Backend creates commit suite -> provides tunnelKey -> create tunnel
*/
static withAutoTunnel(options: TestManagerOptions, endpointUuid: string, tunnelPort?: number): TestManager;
/**
* Run tests for the current commit or working changes
*/
runCommitTests(): Promise<TestResult>;
/**
* Run GitHub App-based PR test - sends single request with PR number
* Backend handles all git analysis via GitHub App integration
*/
runGitHubAppPRTest(): Promise<TestResult>;
/**
* Run PR commit sequence tests - sends individual test requests for each commit
*/
runPRCommitSequenceTests(): Promise<TestResult>;
/**
* Create a test suite for a specific commit in a PR sequence
*/
private createCommitTestSuite;
/**
* Create a test description for a specific commit in a PR sequence
*/
private createCommitTestDescription;
/**
* Wait for the local development server to be ready
*/
waitForServer(port?: number, maxWaitTime?: number): Promise<boolean>;
/**
* Analyze git changes (working changes, specific commit, or commit range)
*/
private analyzeChanges;
/**
* Create a comprehensive test description based on changes
*/
private createTestDescription;
/**
* Analyze file types in the changes
*/
private analyzeFileTypes;
/**
* Save test artifacts (scripts, recordings, etc.) to local directory
*/
private saveTestArtifacts;
/**
* Report test results to console
*/
private reportResults;
/**
* Get colored status text
*/
private getStatusColor;
}
//# sourceMappingURL=test-manager.d.ts.map