Add batch test-run REST endpoint - #1701
Merged
ashishvijaywargiya merged 15 commits intoAug 23, 2026
Merged
Conversation
- Add test for ERROR taking precedence over FAILED - Add test for FAILED taking precedence over RUNNING - Add test for genuinely QUEUED child never marked running
Task 2 added a runId field to describeRun()'s response shape, but getTestRunStatus's service definition still declared runId as IN-only, so the service engine silently dropped it from the actual REST response. Live verification caught the gap. Change runId to mode="INOUT" so it's both the polling key and part of the response, matching what describeRun already returns and what the batch endpoint's per-component entries (which reuse describeRun) already include.
… document known limitations
Contributor
|
Could you please have a look at the following warning message generated by the code at line 330 of the TestRunServicesTest class? Thanks! |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a batch endpoint on top of the existing test-run REST API in framework/testtools, fanning a
full-suite run out to multiple components in one call, tracked under one batchId:
POST /rest/testtools/testruns/batch
GET /rest/testtools/testruns/batch/{batchId}
With no components list, every component that has a testdef and has the test execution API
enabled is queued automatically. With an explicit components list, an empty list is rejected
outright, and every named component must itself be known, have a testdef, and be enabled, or the
whole call is rejected up front naming which entries were invalid - no batch is ever queued from
an invalid or empty list. A component that passes this upfront check but still fails its actual
test run (e.g. a testdef that resolves to zero tests) is omitted from the batch rather than
failing the whole call, the same way an auto-discovered component would be. Each queued component
always runs its whole suite through the existing runTestSuite service, called as a plain Java
method, not through the service engine, so the batch stays serialized on the same single-threaded
executor runTestSuite already uses - no new concurrency anywhere in this change.
getBatchTestRunStatus polls a batch's aggregate status (QUEUED/RUNNING/PASSED/FAILED/ERROR,
rolled up from its children's own tracked statuses) plus each component's own runId/status/
resultSummary, reusing the same response shape GET testruns/{runId} already returns for that
runId.
No change to the existing single-component runTestSuite/getTestRunStatus contract, except one
additive field: getTestRunStatus's response now also includes runId alongside the existing
status/componentName/resultSummary.
Testing
passing, including status-rollup precedence (a batch with one ERROR and one FAILED child rolls
up to ERROR, not FAILED, etc.), duplicate-component-list dedup, and rejecting a batch where
every requested component's runTestSuite call fails outright rather than silently reporting
PASSED with zero children.
component, explicit-list batch, both 422 edge cases (an unknown component in an explicit list;
the test execution API disabled globally), and the existing single-component endpoint's
unaffected behavior plus the additive runId field.