UpdateUnitTest
Update an ABAP unit test run using its run identifier. Note: ADT returns an error as updating unit test runs is not supported.
Instructions
Update an ABAP Unit test run. Note: ADT does not support updating unit test runs and will return an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | Run identifier returned by CreateUnitTest/RunUnitTest. |
Implementation Reference
- Main handler function for UpdateUnitTest tool. Calls AdtClient.getUnitTest().update() with the run_id argument. Catches and logs errors, returning structured success/error responses.
export async function handleUpdateUnitTest( context: HandlerContext, args: UpdateUnitTestArgs, ) { const { connection, logger } = context; try { const { run_id } = args as UpdateUnitTestArgs; if (!run_id) { return return_error(new Error('run_id is required')); } const client = createAdtClient(connection, logger); const unitTest = client.getUnitTest(); logger?.info(`Updating unit test run: ${run_id}`); try { await unitTest.update({ runId: run_id }); return return_response({ data: JSON.stringify( { success: true, run_id, message: `Unit test run ${run_id} updated successfully.`, }, null, 2, ), } as AxiosResponse); } catch (error: any) { const detailedError = extractAdtErrorMessage( error, `Failed to update unit test run ${run_id}`, ); logger?.error(`Error updating unit test run ${run_id}: ${detailedError}`); return return_error(new Error(detailedError)); } } catch (error: any) { return return_error(error); } } - Tool definition including name 'UpdateUnitTest', description, availability (onprem/cloud/legacy), and inputSchema requiring 'run_id' (string).
export const TOOL_DEFINITION = { name: 'UpdateUnitTest', available_in: ['onprem', 'cloud', 'legacy'] as const, description: 'Update an ABAP Unit test run. Note: ADT does not support updating unit test runs and will return an error.', inputSchema: { type: 'object', properties: { run_id: { type: 'string', description: 'Run identifier returned by CreateUnitTest/RunUnitTest.', }, }, required: ['run_id'], }, } as const; - TypeScript interface UpdateUnitTestArgs defining the run_id input parameter.
interface UpdateUnitTestArgs { run_id: string; } - src/lib/handlers/groups/HighLevelHandlersGroup.ts:448-451 (registration)Import of handleUpdateUnitTest and its TOOL_DEFINITION from the handler file.
import { handleUpdateUnitTest, TOOL_DEFINITION as UpdateUnitTest_Tool, } from '../../../handlers/unit_test/high/handleUpdateUnitTest'; - src/lib/handlers/groups/HighLevelHandlersGroup.ts:797-800 (registration)Registration of UpdateUnitTest tool in the HighLevelHandlersGroup with its toolDefinition and handler wrapped with context.
{ toolDefinition: UpdateUnitTest_Tool, handler: withContext(handleUpdateUnitTest), },