Class CustomExecutionHistoryRepository

java.lang.Object
org.qubership.atp.ram.repositories.impl.CustomExecutionHistoryRepository
All Implemented Interfaces:
FieldConstants

@Repository public class CustomExecutionHistoryRepository extends Object implements FieldConstants
  • Constructor Details

    • CustomExecutionHistoryRepository

      public CustomExecutionHistoryRepository()
  • Method Details

    • getTestCaseExecutions

      Get test case executions by test case id with pagination support. Example of generated query: [ { "$match":{ "testCaseId":JUUID("942dec40-19f0-4c1a-b8ce-0e0faaaac18c"), "testingStatus":{ "$in":["PASSED", "FAILED"] }, "rootCauseId":{ "$in":[JUUID("5bbf39f7-9aaf-44c2-b8cd-b44562d017ac")] } } }, { "$lookup":{ "from":"executionRequests", "localField":"executionRequestId", "foreignField":"_id", "as":"executionRequest" } }, { "$lookup":{ "from":"rootCause", "localField":"rootCauseId", "foreignField":"_id", "as":"rootCause" } }, { "$unwind":"$executionRequest" }, { "$unwind":"$rootCause" }, { "$match":{ "executionRequest.environmentId":{ "$in":[JUUID("42cc4271-aa0f-4571-a7e0-d46f37001708")] }, "executionRequest.executorId":{ "$in":[JUUID("0ba2b3a5-3546-47cc-a4cf-2fffe6e58348")] }, "executionRequest.analyzedByQa":false } }, { "$project":{ "projectId":"$executionRequest.projectId", "executionRequestId":"$executionRequest._id", "executionRequestName":"$executionRequest.name", "testingStatus":1, "analyzedByQa":"$executionRequest.analyzedByQa", "startDate":1, "finishDate":1, "duration":1, "passedRate":"$executionRequest.passedRate", "warningRate":"$executionRequest.warningRate", "failedRate":"$executionRequest.failedRate", "environmentId":"$executionRequest.environmentId", "executorId":"$executionRequest.executorId", "executorName":"$executionRequest.executorName", "filteredByLabelsIds":"$executionRequest.filteredByLabels", "failReason":"$rootCause.name", "testRunId":"$_id" } }, { "$sort":{ "startDate":-1 } }, { "$facet":{ "entities":[ { "$skip":0 }, { "$limit":15 } ], "metadata":[ { "$group":{ "_id":null, "totalCount":{ "$sum":1 } } } ] } }, { "$project":{ "entities":1, "totalCount":{ "$arrayElemAt":[ "$metadata.totalCount", 0 ] } } } ]
      Parameters:
      request - search request
      testCaseId - test case identifier
      Returns:
      test case executions list