Package org.qubership.atp.ram.services
Class ExecutionRequestService
java.lang.Object
org.qubership.atp.ram.services.CrudService<ExecutionRequest>
org.qubership.atp.ram.services.ExecutionRequestService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildExecutionRequestResponses(List<ExecutionRequest> executionRequests) Returns list of short ERs.voidvoiddeleteAllExecutionRequestByExecutionRequestId(List<UUID> executionRequestIds) Deleted ExecutionRequest.findAllByJointExecutionKey(String jointExecutionKey) findAllByUuidIn(List<UUID> uuids) Returns all ERs with the specified ids.findAllRequestsNotFinished(UUID projectId) Find execution request by id.findByIdMainInfo(UUID id) FindExecutionRequestmain info by specified identifier.findByTestPlanId(UUID testPlanId) Return List of ER-s in standard format.findByTestPlanUuid(UUID testPlanUuid) Returns list of ERs by TestPlanUuid.findByTestScopeUuid(UUID testScopeUuid) findExpireExecutionRequest(Timestamp qwe, UUID projectId) Find all Execution Requests by expired period.findFinishedErByProjectAndSortByFinishDate(UUID projectUuid) Returns list of ERs by ProjectUuid.findFinishedErByProjectAndSortByFinishDate(UUID projectUuid, Timestamp dateFilter) Returns list of ERs by ProjectUuid.findPageByTestPlanUuidAndAnalyzedByQa(UUID testPlanUuid, Boolean analyzedByQa, int startIndex, int endIndex) Returns page of ERs by the specified test plan id with specified analyzed by qa value and sorted in a descending order by finish date.findPageByTestPlanUuidAndSort(UUID testPlanUuid, int startIndex, int endIndex, String columnType, String sortType) Find ER-s by test plan, sort and limit results.findPageByTestPlanUuidBetweenPeriodAndAnalyzedByQa(UUID testPlanUuid, Timestamp startDate, Timestamp endDate, Boolean analyzedByQa, int startIndex, int endIndex) Returns page of ERs by the specified test plan id with: specified analyzed by qa value, finish date between startDate and endDate, sorted in a descending order by finish date.findPageByTestPlanUuidBetweenPeriodAndSort(UUID testPlanUuid, Timestamp startDate, Timestamp endDate, int startIndex, int endIndex, String columnType, String sortType) Returns list of ERs by TestPlanUuid and sort.findResponsePageByTestPlanUuidAndSort(UUID testPlanUuid, int startIndex, int endIndex, String columnType, String sortType) Returns list of ERs by TestPlanUuid and sort, shortened into DTOs.findStepBySearchValue(UUID uuidRequest, String searchValue) Find test runs and log records with names, which contain searchValue.generateErLink(UUID executionRequestId, UUID projectId) Create link for execution request.getAllEnrichedTestRuns(UUID executionRequestId) getAllFailedTestRuns(UUID executionRequestId) getAllTestRuns(UUID executionRequestId) getAllTestRunUuidsByExecutionRequestId(UUID executionRequestId) Get all Test Run ids by Execution Request id.getComparisonExecutionRequest(List<UUID> uuids) Returns list of ERs by list uuid for compare.Returns list of ERs with steps by list uuid for compare.getExecutionRequestConfig(UUID executionRequestId) Get execution request config.getExecutionRequestConfig(ExecutionRequest executionRequest) Get execution request config.getExecutionRequestEnvironments(List<ExecutionRequest> executionRequests) Get execution request environments.getExecutionRequestEnvironments(UUID testPlanId) Get execution request environments.Get ER executor info by identifier.getExecutionRequestExecutors(Set<UUID> userIds) Get executors by user identifiers.getExecutionRequestExecutors(UUID testPlanId) Get execution request executor users.getExecutionRequests(UUID testPlanUuid, ExecutionRequestSearchRequest request) Get ExecutionRequests by filtering, sorting and pagination.getExecutionRequestsAndFilteredByLabelsMap(List<ExecutionRequest> executionRequests, List<Label> labels) Get map of execution request ids and execution request's labels.getExecutionRequestsByIds(Collection<UUID> executionRequestsIds) Find ExecutionRequests with Suspended status.getExecutionRequestsLabels(List<ExecutionRequest> executionRequests) Get labels by list of execution requests.getExecutionRequestsResponse(UUID testPlanUuid, ExecutionRequestSearchRequest req) Get ExecutionRequests by filtering, sorting and pagination and build ExecutionRequestResponse from it.getFailureReasons(UUID executionRequestId) Get failure reasons for execution request.getLastErsByProjectUuidWithTestRuns(UUID projectUuid) Returns list of ERs with qaHosts and taHosts by ProjectUuid.getLastErsByTestplanUuidWithQaHostsAndTaHosts(UUID testPlanUuid) Return list of ERs with qaHosts and taHosts by TestPlanUuid.getMapTestRunsForExecutionRequests(List<UUID> executionRequests) Get map of Test Runs with ER Id's as keys.getMapTestRunsWithScreenShotsForExecutionRequests(List<UUID> executionRequests) Get map of Test Runs (with screenshots) with ER Id's as keys.Returns list of ERs with filled only requestUuid field.getOrderedExecutionRequestsByIds(Collection<UUID> executionRequestsIds) Find ordered ExecutionRequests by ids.getProjectId(UUID executionRequestId) Get execution request project.getProjectId(UUID projectId, UUID executionRequestId) Gets project id by execution request id if provided project id is Null.Get project ID by execution request ID.getProjectIdByTestScopeId(UUID testScopeId) Returns project ids by testScopeId.Returns project ids by execution request ids.Returns project ids by execution request ids.Get execution request rates info.getRequestsForResuming(List<UUID> executionRequestsIds) Find ExecutionRequests with Suspended status.getRequestsForStoppingOrTerminating(List<UUID> executionRequestsIds) Find ExecutionRequests with In Progress status.getSortedExecutionRequestsForTestPlan(UUID testPlanUuid) Get sorted and limited execution requests for current test plan.Returns an Test Plan id by Execution Request Id.getTestResultsByRestScopeUuid(UUID testScopeUuid) Returns list of ERs with TestRuns by TestScopeUuid.voidinit()Creates property maps for proper execution request mapping.voidrecursiveDeleteListRequests(List<UUID> requestsUuidList) Remove execution request with all test runs and log records.removeLabel(UUID uuidRequest, List<UUID> uuidLabels) Find and remove label from execution request and return updated execution request.protected org.springframework.data.mongodb.repository.MongoRepository<ExecutionRequest, UUID> searchFailedLogRecords(UUID executionRequestId, LogRecordRegexSearchRequest request) Search execution request failed log records by regex.searchTestRunsByValidationLabels(UUID id, TestRunsByValidationLabelsRequest testRunsRequest, Integer page, Integer size) Searches test runs by names, statuses, labels, validation labels.Set label to execution request and return updated object.voidstopExecutionRequest(ExecutionRequest er, long lastFinishDate) Deprecated.use ExecutionRequestLoggingController instead of thisvoidupdateAnalyzedByQa(Collection<UUID> executionRequestIds, boolean value) Update analysed by qa field in provided execution requests.voidupdateExecutionRequestConfig(UUID executionRequestId, ExecutionRequestConfigUpdateRequest request) Update execution request config.voidupdateExecutionRequestConfig(ExecutionRequest executionRequest, ExecutionRequestConfigUpdateRequest request) Update execution request config.updateExecutionStatus(UUID requestUuid, ExecutionStatuses executionStatus) Update execution status ofExecutionRequest.Methods inherited from class org.qubership.atp.ram.services.CrudService
get, getAll, save, saveAll
-
Constructor Details
-
ExecutionRequestService
public ExecutionRequestService()
-
-
Method Details
-
repository
protected org.springframework.data.mongodb.repository.MongoRepository<ExecutionRequest,UUID> repository()- Specified by:
repositoryin classCrudService<ExecutionRequest>
-
getAllSortedExecutionRequests
-
init
Creates property maps for proper execution request mapping. -
getComparisonExecutionRequest
Returns list of ERs by list uuid for compare.- Parameters:
uuids- List uuid Execution Requests.- Returns:
- Set comparison Execution Request.
-
getComparisonExecutionRequestWithSteps
Returns list of ERs with steps by list uuid for compare.- Parameters:
uuids- List uuid Execution Requests.- Returns:
- Set comparison Execution Request.
-
getAllTestRuns
-
getAllTestRunUuidsByExecutionRequestId
Get all Test Run ids by Execution Request id.- Parameters:
executionRequestId- Execution Request id.- Returns:
- List of Test Run id's.
-
getAllEnrichedTestRuns
-
getDataForTestResultByExecutionRequests
-
getAllFailedTestRuns
-
delete
-
findById
Find execution request by id.- Parameters:
executionRequestId- execution request identifier- Returns:
- execution request
-
findByIdMainInfo
FindExecutionRequestmain info by specified identifier.- Parameters:
id- identifier- Returns:
- info response
-
getExecutionRequestExecutor
Get ER executor info by identifier.- Parameters:
id- executor identifier- Returns:
- executor info
-
getRequestsForStoppingOrTerminating
Find ExecutionRequests with In Progress status.- Parameters:
executionRequestsIds- set of ER ids.- Returns:
- ids of ERs with In Progress status.
-
getRequestsForResuming
Find ExecutionRequests with Suspended status.- Parameters:
executionRequestsIds- set of ER ids.- Returns:
- ids of ERs with Suspended status.
-
getExecutionRequestsByIds
Find ExecutionRequests with Suspended status.- Parameters:
executionRequestsIds- set of ER ids.- Returns:
- ids of ERs with Suspended status.
-
getOrderedExecutionRequestsByIds
public List<ExecutionRequest> getOrderedExecutionRequestsByIds(Collection<UUID> executionRequestsIds) Find ordered ExecutionRequests by ids.- Parameters:
executionRequestsIds- set of ER ids.- Returns:
- ERs.
-
setLabel
Set label to execution request and return updated object.- Parameters:
uuid- of execution request for updateuuidLabels- uuid of labels for remove- Returns:
- updated object
ExecutionRequest
-
removeLabel
Find and remove label from execution request and return updated execution request.- Parameters:
uuidRequest- uuid of execution request for updateuuidLabels- uuid of labels for remove- Returns:
- updated object
ExecutionRequest
-
findStepBySearchValue
Find test runs and log records with names, which contain searchValue.- Returns:
- list of found objects
-
getLastErsByProjectUuidWithTestRuns
Returns list of ERs with qaHosts and taHosts by ProjectUuid.- Parameters:
projectUuid- Project Id- Returns:
- List of ExecutionRequestTestResult
-
getLastErsByTestplanUuidWithQaHostsAndTaHosts
Return list of ERs with qaHosts and taHosts by TestPlanUuid.- Parameters:
testPlanUuid- for found ERs- Returns:
- list of
TestResult
-
getTestResultsByRestScopeUuid
Returns list of ERs with TestRuns by TestScopeUuid.- Parameters:
testScopeUuid- for found ERs- Returns:
- list of
TestResult
-
findByTestPlanId
Return List of ER-s in standard format.- Parameters:
testPlanId- for found ER-s- Returns:
- list of ER-s
-
findByTestPlanUuid
Returns list of ERs by TestPlanUuid. -
findFinishedErByProjectAndSortByFinishDate
Returns list of ERs by ProjectUuid. -
findFinishedErByProjectAndSortByFinishDate
public List<ExecutionRequest> findFinishedErByProjectAndSortByFinishDate(UUID projectUuid, Timestamp dateFilter) Returns list of ERs by ProjectUuid. -
findPageByTestPlanUuidAndSort
public List<ExecutionRequest> findPageByTestPlanUuidAndSort(UUID testPlanUuid, int startIndex, int endIndex, String columnType, String sortType) Find ER-s by test plan, sort and limit results.- Parameters:
testPlanUuid- for find ER-sstartIndex- number of start elementendIndex- number of finish elementcolumnType- field for sortingsortType- direction of sorting- Returns:
- sorted ER-s by test plan
-
findResponsePageByTestPlanUuidAndSort
public List<ExecutionRequestResponse> findResponsePageByTestPlanUuidAndSort(UUID testPlanUuid, int startIndex, int endIndex, String columnType, String sortType) Returns list of ERs by TestPlanUuid and sort, shortened into DTOs. -
buildExecutionRequestResponses
public List<ExecutionRequestResponse> buildExecutionRequestResponses(List<ExecutionRequest> executionRequests) Returns list of short ERs. -
getExecutionRequestEnvironments
Get execution request environments.- Parameters:
testPlanId- test plan id search param- Returns:
- found environments
-
getExecutionRequestEnvironments
Get execution request environments.- Returns:
- found environments
-
getExecutionRequestsLabels
Get labels by list of execution requests.- Parameters:
executionRequests- list of execution requests- Returns:
- list of found labels
-
getExecutionRequestsAndFilteredByLabelsMap
public Map<UUID,List<Label>> getExecutionRequestsAndFilteredByLabelsMap(List<ExecutionRequest> executionRequests, List<Label> labels) Get map of execution request ids and execution request's labels.- Parameters:
executionRequests- list of execution requestslabels- list of labels- Returns:
- map of execution request ids and execution request's labels
-
getExecutionRequestExecutors
public List<ExecutionRequestMainInfoResponse.Executor> getExecutionRequestExecutors(UUID testPlanId) Get execution request executor users.- Parameters:
testPlanId- test plan id search param- Returns:
- found users
-
getExecutionRequestExecutors
public List<ExecutionRequestMainInfoResponse.Executor> getExecutionRequestExecutors(Set<UUID> userIds) Get executors by user identifiers.- Parameters:
userIds- user identifiers- Returns:
- list of executors
-
findPageByTestPlanUuidBetweenPeriodAndSort
public List<ExecutionRequest> findPageByTestPlanUuidBetweenPeriodAndSort(UUID testPlanUuid, Timestamp startDate, Timestamp endDate, int startIndex, int endIndex, String columnType, String sortType) Returns list of ERs by TestPlanUuid and sort. -
recursiveDeleteListRequests
Remove execution request with all test runs and log records.- Parameters:
requestsUuidList- list of uuid of execution request
-
getNotFinishedRequests
Returns list of ERs with filled only requestUuid field. -
stopExecutionRequest
Deprecated.use ExecutionRequestLoggingController instead of thisStops ER with provided UUID. -
findAllByJointExecutionKey
-
getProjectId
Get execution request project.- Parameters:
executionRequestId- er id- Returns:
- found project
-
getProjectId
Gets project id by execution request id if provided project id is Null. -
getProjectIdByExecutionRequestId
Get project ID by execution request ID.- Parameters:
id- ID of Execution request- Returns:
- UUID of project.
-
getSortedExecutionRequestsForTestPlan
Get sorted and limited execution requests for current test plan.- Parameters:
testPlanUuid- for found- Returns:
- sorted by start date and limited list of
ExecutionRequest
-
updateExecutionStatus
Update execution status ofExecutionRequest.- Parameters:
requestUuid- for findExecutionRequestexecutionStatus- new value of status- Returns:
- updated
ExecutionRequest
-
findAllRequestsNotFinished
-
findAllByUuidIn
Returns all ERs with the specified ids. -
findPageByTestPlanUuidBetweenPeriodAndAnalyzedByQa
public List<ExecutionRequest> findPageByTestPlanUuidBetweenPeriodAndAnalyzedByQa(UUID testPlanUuid, Timestamp startDate, Timestamp endDate, Boolean analyzedByQa, int startIndex, int endIndex) Returns page of ERs by the specified test plan id with: specified analyzed by qa value, finish date between startDate and endDate, sorted in a descending order by finish date.- Parameters:
analyzedByQa- if null ignored
-
findPageByTestPlanUuidAndAnalyzedByQa
public List<ExecutionRequest> findPageByTestPlanUuidAndAnalyzedByQa(UUID testPlanUuid, Boolean analyzedByQa, int startIndex, int endIndex) Returns page of ERs by the specified test plan id with specified analyzed by qa value and sorted in a descending order by finish date.- Parameters:
analyzedByQa- may be null in this case it is not taken into account
-
updateAnalyzedByQa
Update analysed by qa field in provided execution requests.- Parameters:
executionRequestIds- execution request idsvalue- analysed by qa value
-
getTestPlanIdByExecutionRequestId
Returns an Test Plan id by Execution Request Id.- Parameters:
id- Execution Request identifier- Returns:
- Test Plan identifier
-
generateErLink
Create link for execution request.- Parameters:
executionRequestId- ID of execution requestprojectId- ID of project- Returns:
- generated link
-
getExecutionRequestConfig
Get execution request config.- Parameters:
executionRequestId- execution request identifier- Returns:
- config
-
getExecutionRequestConfig
Get execution request config.- Parameters:
executionRequest- execution request- Returns:
- config
-
updateExecutionRequestConfig
public void updateExecutionRequestConfig(UUID executionRequestId, ExecutionRequestConfigUpdateRequest request) Update execution request config.- Parameters:
executionRequestId- execution requestrequest- update request
-
updateExecutionRequestConfig
@CacheEvict(value="ATP_RAM-REPORTS",key="{#executionRequest.getUuid(), #executionRequest.getCountLogRecords(), T(org.qubership.atp.ram.enums.ExecutionRequestWidgets).SUMMARY_STATISTIC}") @CacheEvict(value="ATP_RAM-REPORTS",key="{#executionRequest.getUuid(), #executionRequest.getCountLogRecords(), T(org.qubership.atp.ram.enums.ExecutionRequestWidgets).SUMMARY_STATISTIC_FOR_USAGES}") @CacheEvict(value="ATP_RAM-REPORTS",key="{#executionRequest.getUuid(), #executionRequest.getCountLogRecords(), T(org.qubership.atp.ram.enums.ExecutionRequestWidgets).SUMMARY_STATISTIC_SCENARIO_TYPE}") @CacheEvict(value="ATP_RAM-REPORTS",key="{#executionRequest.getUuid(), #executionRequest.getCountLogRecords(), T(org.qubership.atp.ram.enums.ExecutionRequestWidgets).TEST_CASES}") @CacheEvict(value="ATP_RAM-REPORTS",key="{#executionRequest.getUuid(), #executionRequest.getCountLogRecords(), T(org.qubership.atp.ram.enums.ExecutionRequestWidgets).TOP_ISSUES}") public void updateExecutionRequestConfig(ExecutionRequest executionRequest, ExecutionRequestConfigUpdateRequest request) Update execution request config.- Parameters:
executionRequest- execution requestrequest- update request
-
getExecutionRequests
public PaginatedResponse<ExecutionRequest> getExecutionRequests(UUID testPlanUuid, ExecutionRequestSearchRequest request) Get ExecutionRequests by filtering, sorting and pagination.- Parameters:
testPlanUuid- testPlanIdrequest- pagination, sorting and filtering params- Returns:
- list of ExecutionRequest
-
getExecutionRequestsResponse
public PaginatedResponse<ExecutionRequestResponse> getExecutionRequestsResponse(UUID testPlanUuid, ExecutionRequestSearchRequest req) Get ExecutionRequests by filtering, sorting and pagination and build ExecutionRequestResponse from it.- Parameters:
testPlanUuid- testPlanIdreq- pagination, sorting and filtering params- Returns:
- list of ExecutionRequestResponse
-
getRates
Get execution request rates info.- Parameters:
executionRequestId- execution request id- Returns:
- rates response
-
searchFailedLogRecords
public LogRecordRegexSearchResponse searchFailedLogRecords(UUID executionRequestId, LogRecordRegexSearchRequest request) Search execution request failed log records by regex.- Parameters:
executionRequestId- execution request identifierrequest- search request- Returns:
- search result
-
getMapTestRunsForExecutionRequests
Get map of Test Runs with ER Id's as keys.- Parameters:
executionRequests- List of Execution Request Id's.- Returns:
- Map of Test Runs.
-
getMapTestRunsWithScreenShotsForExecutionRequests
public Map<UUID,List<TestRun>> getMapTestRunsWithScreenShotsForExecutionRequests(List<UUID> executionRequests) Get map of Test Runs (with screenshots) with ER Id's as keys.- Parameters:
executionRequests- List of Execution Request Id's.- Returns:
- Map of Test Runs.
-
searchTestRunsByValidationLabels
public TestRunsByValidationLabelsResponse searchTestRunsByValidationLabels(UUID id, TestRunsByValidationLabelsRequest testRunsRequest, Integer page, Integer size) Searches test runs by names, statuses, labels, validation labels.- Parameters:
id- execution request idtestRunsRequest- filter for searchpage- pagesize- size- Returns:
- Found test runs with validation labels
-
getProjectIdsByExecutionRequestIds
Returns project ids by execution request ids. -
getProjectIdsByExecutionRequestIds
Returns project ids by execution request ids. -
getProjectIdByTestScopeId
Returns project ids by testScopeId. -
findByTestScopeUuid
-
getFailureReasons
Get failure reasons for execution request. -
findExpireExecutionRequest
Find all Execution Requests by expired period. -
deleteAllExecutionRequestByExecutionRequestId
Deleted ExecutionRequest.
-