You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scenarios/syntax-error-recovery.md and the other 3 new scenarios
Background: v1 of the mock only covered the create-class-hello
flow. v1.1 needs the other SAP ADT endpoints so the new scenarios
can be exercised end-to-end. All responses must match the SAP
namespace (e.g. application/vnd.sap.adt.checkmessages+xml, application/vnd.sap.adt.api.junit.run-result.v1+xml).
Out of scope
Replicating the entire SAP ADT surface. Only the ~8 endpoints listed
below are in scope.
application/vnd.sap.as+xml;dataname=com.sap.adt.transport.service.checkData with REQUESTS block. For $TMP packages, return empty REQUESTS and RESULT=S. For others, return a synthetic DEVK900123.
POST
/sap/bc/adt/checkruns
application/xml
application/vnd.sap.adt.checkmessages+xml. Empty <messages> on success; populated with <msg:message severity="error" ...> on failure.
Issue #5 — Extend mock ADT server
Task
Extend
@adt-bench/mock-adt-serverto cover the endpoints the v1.1scenarios need:
transportchecks,checkruns(with structured errormessages), AUnit (start / poll / results, with a JUnit-formatted
response), BDEF create + activate.
Context
packages/mock-adt-server/src/server.ts(the v1 16-endpoint implementation)packages/mock-adt-server/specs/SPEC.mdpackages/mock-adt-server/src/server.spec.ts(test patterns)scenarios/syntax-error-recovery.mdand the other 3 new scenariosflow. v1.1 needs the other SAP ADT endpoints so the new scenarios
can be exercised end-to-end. All responses must match the SAP
namespace (e.g.
application/vnd.sap.adt.checkmessages+xml,application/vnd.sap.adt.api.junit.run-result.v1+xml).Out of scope
below are in scope.
polish issue (v1.1: document mock ADT coverage and return 501 for unmocked endpoints #12).
Files to add or modify
packages/mock-adt-server/src/server.ts— add handlers for the 8 newendpoints.
packages/mock-adt-server/src/server.spec.ts— add tests per endpoint.packages/mock-adt-server/specs/SPEC.md— update the endpoint table.docs/mock-adt-coverage.md(new) — full coverage matrix per v1.1: document mock ADT coverage and return 501 for unmocked endpoints #12; thisissue just adds the new endpoints to it.
Endpoints to add
POST/sap/bc/adt/cts/transportchecksapplication/vnd.sap.as+xml;dataname=com.sap.adt.transport.service.checkDataapplication/vnd.sap.as+xml;dataname=com.sap.adt.transport.service.checkDatawithREQUESTSblock. For$TMPpackages, return emptyREQUESTSandRESULT=S. For others, return a syntheticDEVK900123.POST/sap/bc/adt/checkrunsapplication/xmlapplication/vnd.sap.adt.checkmessages+xml. Empty<messages>on success; populated with<msg:message severity="error" ...>on failure.POST/sap/bc/adt/abapunit/testrunsapplication/vnd.sap.adt.api.abapunit.run-config.v1+xml202 AcceptedwithLocation: /sap/bc/adt/abapunit/testruns/{runId}. Generate UUID, store inrunsmap.GET/sap/bc/adt/abapunit/testruns/{runId}application/vnd.sap.adt.api.abapunit.run-status.v1+xmlwithstatus="completed"after a 50–200ms delay.GET/sap/bc/adt/abapunit/testruns/{runId}/resultsapplication/vnd.sap.adt.api.junit.run-result.v1+xmlwith real JUnit XML. If the class source contains!@MOCK_AUNIT_FAIL, emit 1 failure.POST/sap/bc/adt/ddic/ddl/sourcesapplication/vnd.sap.adt.ddl.source.v1+xml201 Created. For BDEF-as-DDL.POST/sap/bc/adt/ddic/behaviordefapplication/vnd.sap.adt.behaviordefinition.v1+xml201 Created.POST/sap/bc/adt/ddic/behaviordef/{name}?_action=activate200withactivationResultXML.Plus existing endpoint tweaks:
GET /sap/bc/adt/discovery— add the new collections(
cts.transportchecks,checkruns,abapunit.testruns,ddic.ddl.sources,ddic.behaviordef).Steps
runsmap for AUnit state:Map<runId, { status, resultId, startedAt }>.transportRequestsmap for transportchecks:Map<name, trNumber>.server.ts, in the same style as the existingclassMatch/srcMatchblocks.setTimeoutto flipstatus: 'running' -> 'completed'after 50–200ms.
server.spec.tstest per new endpoint, mirroring thelock -> write -> unlock -> activatetest for classes.docs/mock-adt-coverage.mdwith the new entries (matrix form:endpoint → status → spec reference).
Deliverables
docs/mock-adt-coverage.mdlisting every endpoint with status.Test plan
pnpm bench:run --scenario syntax-error-recoveryshouldnow be runnable (it was blocked on
checkruns).pnpm bench:matrix --scenarios allruns all 6scenarios with the simulated agent.
Acceptance gate
pnpm verifyexits 0.syntax-error-recoveryforcheckruns) produces aresults/<id>/result.json.Definition of done
docs/mock-adt-coverage.mdcreated with the full matrix.pnpm verifyexits 0.feat(mock-adt): add transportchecks, checkruns, AUnit, BDEF endpoints.Dependencies
Blocked by none.
Blocks #4 (3 of the 4 new scenarios need these endpoints) and #12
(coverage docs reference these endpoints).