gitlabgitlab-api

Is there a Gitlab API Call for "Tests Tab" under Pipeline?


I need to get the content of the tests tab, but I didn't find one for that.

Unfortunately the response of /gitlab/api/v4/projects/{projectId}/pipelines/{pipelineId} doesn't return the tests tab


Solution

  • Without being the tests tab, check if the data returned by the "pipeline’s test report" includes what you need:

    GET /projects/:id/pipelines/:pipeline_id/test_report
    
    {
      "total_time": 5,
      "total_count": 1,
      "success_count": 1,
      "failed_count": 0,
      "skipped_count": 0,
      "error_count": 0,
      "test_suites": [
        {
          "name": "Secure",
          "total_time": 5,
          "total_count": 1,
          "success_count": 1,
          "failed_count": 0,
          "skipped_count": 0,
          "error_count": 0,
          "test_cases": [
            {
              "status": "success",
              "name": "Security Reports can create an auto-remediation MR",
              "classname": "vulnerability_management_spec",
              "execution_time": 5,
              "system_output": null,
              "stack_trace": null
            }
          ]
        }
      ]
    }