GetCdsUnitTestResult
Retrieve CDS unit test run results by providing the run identifier, with optional format selection (abapunit or junit) and navigation URIs.
Instructions
Retrieve CDS unit test run result for a run_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | Run identifier returned by unit test run. | |
| with_navigation_uris | No | Include navigation URIs in result if supported. | |
| format | No | Result format: abapunit or junit. |
Implementation Reference
- Main handler function that executes the GetCdsUnitTestResult tool logic. Creates an ADT client, calls cdsUnitTest.read({runId}) to retrieve the unit test result, and returns the run result data.
export async function handleGetCdsUnitTestResult( context: HandlerContext, args: GetCdsUnitTestResultArgs, ) { const { connection, logger } = context; try { const { run_id, with_navigation_uris, format } = args as GetCdsUnitTestResultArgs; if (!run_id) { return return_error(new Error('run_id is required')); } const client = createAdtClient(connection, logger); const cdsUnitTest = client.getCdsUnitTest(); logger?.info(`Reading CDS unit test result for run_id: ${run_id}`); try { const readResult = await cdsUnitTest.read({ runId: run_id }); return return_response({ data: JSON.stringify( { success: true, run_id, run_result: readResult?.runResult, }, null, 2, ), } as AxiosResponse); } catch (error: any) { logger?.error( `Error reading CDS unit test result ${run_id}: ${error?.message || error}`, ); return return_error(new Error(error?.message || String(error))); } } catch (error: any) { return return_error(error); } } - Tool definition with input schema for GetCdsUnitTestResult. Defines required run_id (string), optional with_navigation_uris (boolean), and optional format (enum: abapunit|junit).
export const TOOL_DEFINITION = { name: 'GetCdsUnitTestResult', available_in: ['onprem', 'cloud', 'legacy'] as const, description: 'Retrieve CDS unit test run result for a run_id.', inputSchema: { type: 'object', properties: { run_id: { type: 'string', description: 'Run identifier returned by unit test run.', }, with_navigation_uris: { type: 'boolean', description: 'Include navigation URIs in result if supported.', default: false, }, format: { type: 'string', description: 'Result format: abapunit or junit.', enum: ['abapunit', 'junit'], }, }, required: ['run_id'], }, } as const; - TypeScript interface for GetCdsUnitTestResultArgs (run_id, with_navigation_uris?, format?).
interface GetCdsUnitTestResultArgs { run_id: string; with_navigation_uris?: boolean; format?: 'abapunit' | 'junit'; } - src/lib/handlers/groups/HighLevelHandlersGroup.ts:420-423 (registration)Import of the GetCdsUnitTestResult tool definition and handler from the handler file.
import { TOOL_DEFINITION as GetCdsUnitTestResult_Tool, handleGetCdsUnitTestResult, } from '../../../handlers/unit_test/high/handleGetCdsUnitTestResult'; - src/lib/handlers/groups/HighLevelHandlersGroup.ts:817-820 (registration)Registration of the GetCdsUnitTestResult tool in the HighLevelHandlersGroup tool list, mapping toolDefinition to handler with context.
{ toolDefinition: GetCdsUnitTestResult_Tool, handler: withContext(handleGetCdsUnitTestResult), },