verify_test
Run the project's test suite with auto-detected platform commands. Optionally specify a test file or directory for targeted testing.
Instructions
Run the project's test suite (auto-detected per platform: "pnpm test:run" for Web, "flutter test" for Flutter, "./gradlew test" for Android). Optionally scope to a specific test file or directory. Side effects: executes a shell command with a 5-minute timeout. Returns {success, output}. Use verify_all to run build + test + lint together.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | Yes | Project name (must match a directory under apps/) | |
| testPath | No | Specific test file or directory to run (optional — runs all tests if omitted) |
Implementation Reference
- src/tools-v2/verify.ts:68-134 (handler)The main handler function 'handleVerify' that executes the verify tool logic. It validates input via VerifySchema, detects the project platform, runs specified gates (build/test/lint) via shell commands, and returns results.
export async function handleVerify(args: unknown): Promise<CallToolResult> { return logger.withTool('verify', async () => { // 입력 검증 const parsed = VerifySchema.safeParse(args); if (!parsed.success) { return { content: [{ type: 'text' as const, text: `Validation error: ${parsed.error.message}` }], isError: true }; } const { project, gates } = parsed.data; const projectPath = path.join(APPS_DIR, project); // 플랫폼 감지 const platform = await detectPlatform(projectPath); const commands = PLATFORM_COMMANDS[platform] || PLATFORM_COMMANDS.node; const results: Record<string, { success: boolean; output?: string; error?: string; duration: number }> = {}; for (const gate of gates) { const command = commands[gate]; if (!command) continue; const startTime = Date.now(); const result = await runCommand(command, projectPath); const duration = Date.now() - startTime; results[gate] = { success: result.success, output: result.success ? result.output?.slice(-500) : undefined, error: !result.success ? result.error?.slice(-1000) : undefined, duration }; logger.info(`Gate ${gate} ${result.success ? 'passed' : 'failed'}`, { duration, success: result.success }, 'verify'); } const allPassed = Object.values(results).every(r => r.success); // active_context에 검증 결과 저장 try { db.prepare(` UPDATE active_context SET last_verification = ?, updated_at = CURRENT_TIMESTAMP WHERE project = ? `).run(allPassed ? 'passed' : 'failed', project); } catch { /* ignore */ } return { content: [{ type: 'text' as const, text: JSON.stringify({ project, platform, allPassed, results, summary: Object.entries(results) .map(([gate, r]) => `${gate}: ${r.success ? '✅' : '❌'} (${r.duration}ms)`) .join(', ') }, null, 2) }] }; }, args as Record<string, unknown>); } - src/schemas.ts:90-93 (schema)The VerifySchema which defines the input schema for the 'verify' tool: a project name and an array of verification gates (build, test, lint) with defaults.
export const VerifySchema = z.object({ project: ProjectNameSchema, gates: z.array(VerificationGateSchema).default(['build', 'test', 'lint']).describe('실행할 게이트') }).describe('프로젝트 검증 (빌드/테스트/린트)'); - src/schemas.ts:24-28 (schema)The VerificationGateSchema enum defining valid gate values: 'build', 'test', 'lint'.
export const VerificationGateSchema = z.enum([ 'build', 'test', 'lint' ]).describe('검증 게이트'); - src/tools-v2/verify.ts:12-35 (registration)The tool definition 'verifyTools' array registering the 'verify' tool with its name, description, and inputSchema.
export const verifyTools: Tool[] = [ { name: 'verify', description: `프로젝트 검증 (빌드/테스트/린트). - gates: 실행할 게이트 배열 (기본: 전체) - build: 빌드 검증 - test: 테스트 실행 - lint: 린트 검사 각 게이트 결과와 전체 성공 여부 반환. 실패 시 에러 메시지 포함.`, inputSchema: { type: 'object', properties: { project: { type: 'string', description: '프로젝트명' }, gates: { type: 'array', items: { type: 'string', enum: ['build', 'test', 'lint'] }, description: '실행할 게이트 (기본: 전체)' } }, required: ['project'] } } ]; - src/tools-v2/index.ts:50-52 (registration)The router case in handleToolV2 that dispatches to handleVerify when the tool name is 'verify'.
// Verify case 'verify': return handleVerify(args);