Class CustomTestRunRepositoryImpl
java.lang.Object
org.qubership.atp.ram.repositories.impl.CustomRamObjectImpl
org.qubership.atp.ram.repositories.impl.CustomTestRunRepositoryImpl
- All Implemented Interfaces:
CustomRamObjectRepository,CustomTestRunRepository,FieldConstants
@Repository
public class CustomTestRunRepositoryImpl
extends CustomRamObjectImpl
implements CustomTestRunRepository
Implementation of
CustomTestRunRepository.-
Field Summary
Fields inherited from class org.qubership.atp.ram.repositories.impl.CustomRamObjectImpl
mongoTemplateFields inherited from interface org.qubership.atp.ram.repositories.impl.FieldConstants
_ID, $BROWSER_CONSOLE_LOGS_TABLE, $CHILDREN, $DURATION, $EXECUTION_REQUEST, $EXECUTION_REQUEST_ID, $FINISH_DATE, $ID, $ISSUE, $METADATA, $PARENT_LOG_RECORD_ID, $ROOT_CAUSE, $START_DATE, $TEST_RUN, $TESTING_STATUS, ANALYZED_BY_QA, BROWSER_CONSOLE_LOGS_TABLE, CHILDREN_DEPTH, CREATED_DATE, CREATED_DATE_STAMP, END_DATE, ENTITIES, ENVIRONMENT, ENVIRONMENT_ID, EXECUTION_REQUEST, EXECUTION_REQUEST_NAME, EXECUTION_REQUESTS, EXECUTOR, EXECUTOR_ID, EXECUTOR_NAME, FAIL_PATTERN, FAIL_PATTERN_NAME_FIELD, FAIL_REASON, FAIL_REASON_NAME_FIELD, FAIL_TEST_RUNS_COUNT_FIELD, FAILED_RATE, FILE_NAME, FILE_TYPE, FILTERED_BY_LABELS, FILTERED_BY_LABELS_IDS, ISSUE, JIRA_DEFECTS, JIRA_TICKETS, LAST_UPDATED, LEVEL, LOG_COLLECTOR_DATA, LOG_RECORD_ID, MESSAGE, METADATA, PARENT, PARENT_RECORD_ID, PASSED_RATE, PREVIEW, PROJECT_ID, QA_SYSTEM_INFO_LIST, RESOLVED, RESULTS, ROOT_CAUSE, TA_SYSTEM_INFO_LIST, TEST_RUN, TEST_RUN_ID, TIMESTAMP, TOTAL_COUNT, TYPE, URL, USER_ID, UUID, VALIDATION_LABELS, VALIDATION_STEPS_LABELS, VALIDATION_TABLE, WARNING_RATE -
Constructor Summary
ConstructorsConstructorDescriptionCustomTestRunRepositoryImpl(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate) -
Method Summary
Modifier and TypeMethodDescriptioncompareByExecutionRequestIds(List<UUID> executionRequestIds) findAllByFilter(int page, int size, AnalyzedTestRunSortedColumns sortColumn, org.springframework.data.domain.Sort.Direction sortType, TestRunSearchRequest filter) Find test runs by filter request.* Query example: { "$or":[ { "_id":{ "$in":[ JUUID("d40b0d22-a438-493f-aad9-cb411627cbd9") ] } }, { "$and":[ { "name":{ "$regex":"Upload" } }, { testingStatus":"FAILED" } ] } ] }findProjectIdByTestCaseId(UUID testCaseId) Find project id by test case id.findProjectIdByTestRunId(UUID testRunId) Find project id by test run id.findTestRunsByExecutionRequestAndHasLogRecordsWithFile(UUID executionRequestId, FileType fileType) Find test run with LR-s with file type.findTestRunsByExecutionRequestIdAndNamesAndLabelIds(UUID executionRequestId, List<String> testRunNames, List<UUID> labelIds) findTestRunsIdNameByExecutionRequestIdAndLabelIds(UUID executionRequestId, List<UUID> labelIds) getTestRunsNotInExecutionRequestCompareTable(List<UUID> executionRequestIds) voidupdateStatusesAndFinishDateByTestRunId(UUID testRunId, ExecutionStatuses executionStatus, TestingStatuses testingStatus, Timestamp finishDate, long duration) Methods inherited from class org.qubership.atp.ram.repositories.impl.CustomRamObjectImpl
queryIsId, updateAnyFieldsRamObjectByIdDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.qubership.atp.ram.repositories.CustomTestRunRepository
updateAnyFieldsRamObjectByIdDocument
-
Constructor Details
-
CustomTestRunRepositoryImpl
public CustomTestRunRepositoryImpl(org.springframework.data.mongodb.core.MongoTemplate mongoTemplate)
-
-
Method Details
-
findAllByFilter
public PaginationResponse<TestRun> findAllByFilter(int page, int size, AnalyzedTestRunSortedColumns sortColumn, org.springframework.data.domain.Sort.Direction sortType, TestRunSearchRequest filter) Find test runs by filter request.* Query example: { "$or":[ { "_id":{ "$in":[ JUUID("d40b0d22-a438-493f-aad9-cb411627cbd9") ] } }, { "$and":[ { "name":{ "$regex":"Upload" } }, { testingStatus":"FAILED" } ] } ] }- Specified by:
findAllByFilterin interfaceCustomTestRunRepository- Parameters:
page- page numsize- size numsortColumn- column for sortingsortType- sorting typefilter- filter- Returns:
- filtered test runs
-
findTestRunsByExecutionRequestIdAndNamesAndLabelIds
public List<TestRun> findTestRunsByExecutionRequestIdAndNamesAndLabelIds(UUID executionRequestId, List<String> testRunNames, List<UUID> labelIds) - Specified by:
findTestRunsByExecutionRequestIdAndNamesAndLabelIdsin interfaceCustomTestRunRepository
-
findTestRunsIdNameByExecutionRequestIdAndLabelIds
public List<TestRun> findTestRunsIdNameByExecutionRequestIdAndLabelIds(UUID executionRequestId, List<UUID> labelIds) - Specified by:
findTestRunsIdNameByExecutionRequestIdAndLabelIdsin interfaceCustomTestRunRepository
-
findProjectIdByTestRunId
Find project id by test run id. db.testrun.aggregate([ { $match: { _id: LUUID("ff4f153e-5eb5-c5e9-579b-7f4c4d340aad") } }, { $lookup: { from: "executionRequests", localField: "executionRequestId", foreignField: "_id", as: "executionRequest" } }, { $unwind: "$executionRequest" }, { $project: { "projectId": "$executionRequest.projectId", "_id": 0 } } ] )- Specified by:
findProjectIdByTestRunIdin interfaceCustomTestRunRepository
-
findProjectIdByTestCaseId
Find project id by test case id. db.testrun.aggregate([ { $match: { testCaseId: LUUID("3546872f-0008-d640-a2f8-55bd62abf089") } }, { $limit: 1 }, { $lookup: { from: "executionRequests", localField: "executionRequestId", foreignField: "_id", as: "executionRequest" } }, { $unwind: "$executionRequest" }, { $project: { "projectId": "$executionRequest.projectId", "_id": 0 } } ] )- Specified by:
findProjectIdByTestCaseIdin interfaceCustomTestRunRepository
-
compareByExecutionRequestIds
public List<CompareTreeTestRunResponse> compareByExecutionRequestIds(List<UUID> executionRequestIds) - Specified by:
compareByExecutionRequestIdsin interfaceCustomTestRunRepository
-
getTestRunsNotInExecutionRequestCompareTable
public List<BaseEntityResponse> getTestRunsNotInExecutionRequestCompareTable(List<UUID> executionRequestIds) - Specified by:
getTestRunsNotInExecutionRequestCompareTablein interfaceCustomTestRunRepository
-
updateStatusesAndFinishDateByTestRunId
public void updateStatusesAndFinishDateByTestRunId(UUID testRunId, ExecutionStatuses executionStatus, TestingStatuses testingStatus, Timestamp finishDate, long duration) - Specified by:
updateStatusesAndFinishDateByTestRunIdin interfaceCustomTestRunRepository
-
findTestRunsByExecutionRequestAndHasLogRecordsWithFile
public List<TestRun> findTestRunsByExecutionRequestAndHasLogRecordsWithFile(UUID executionRequestId, FileType fileType) Find test run with LR-s with file type. Query example: db.testrun.aggregate( { $match: { executionRequestId: erIdVar, } }, { $graphLookup: { from: "logrecord", startWith: "$_id", connectFromField: "testRunId", connectToField: "testRunId", as: "children", depthField: "depth", restrictSearchWithMatch: { "fileMetadata.type": "POT" } } }, { $match: { "children.0": {$exists: true} } }, { $project: { children: 0 } }, )- Specified by:
findTestRunsByExecutionRequestAndHasLogRecordsWithFilein interfaceCustomTestRunRepository- Parameters:
executionRequestId- for find TR-sfileType- for find LR-s- Returns:
- list of TR-s
-