feat(tests): implement test runner functionality with API integration

- Added Test Runner Service to manage test execution processes for worktrees.
- Introduced endpoints for starting and stopping tests, and retrieving test logs.
- Created UI components for displaying test logs and managing test sessions.
- Integrated test runner events for real-time updates in the UI.
- Updated project settings to include configurable test commands.

This enhancement allows users to run tests directly from the UI, view logs in real-time, and manage test sessions effectively.
This commit is contained in:
Shirone
2026-01-21 15:45:33 +01:00
parent c3e7e57968
commit afa93dde0d
28 changed files with 3322 additions and 19 deletions

View File

@@ -47,6 +47,12 @@ export type EventType =
| 'dev-server:started'
| 'dev-server:output'
| 'dev-server:stopped'
| 'test-runner:started'
| 'test-runner:progress'
| 'test-runner:output'
| 'test-runner:completed'
| 'test-runner:error'
| 'test-runner:result'
| 'notification:created';
export type EventCallback = (type: EventType, payload: unknown) => void;

View File

@@ -335,3 +335,6 @@ export { PR_STATES, validatePRState } from './worktree.js';
// Terminal types
export type { TerminalInfo } from './terminal.js';
// Test runner types
export type { TestRunnerInfo } from './test-runner.js';

View File

@@ -1182,6 +1182,14 @@ export interface ProjectSettings {
/** Maximum concurrent agents for this project (overrides global maxConcurrency) */
maxConcurrentAgents?: number;
// Test Runner Configuration
/**
* Custom command to run tests for this project.
* If not specified, auto-detection will be used based on project structure.
* Examples: "npm test", "yarn test", "pnpm test", "pytest", "go test ./..."
*/
testCommand?: string;
// Phase Model Overrides (per-project)
/**
* Override phase model settings for this project.

View File

@@ -0,0 +1,17 @@
/**
* Test runner types for the test runner functionality
*/
/**
* Information about an available test runner
*/
export interface TestRunnerInfo {
/** Unique identifier for the test runner (e.g., 'vitest', 'jest', 'pytest') */
id: string;
/** Display name of the test runner (e.g., "Vitest", "Jest", "Pytest") */
name: string;
/** CLI command to run all tests */
command: string;
/** Optional: CLI command pattern to run a specific test file */
fileCommand?: string;
}