---
title: "Get a list of test containers."
method: GET
path: "/api/tests/containers"
tags: ["Tests", "Develocity"]
---

# Get a list of test containers.

`GET /api/tests/containers`

## Request

- Base URL: `https://develocity.example.com`
- URL: `https://develocity.example.com/api/tests/containers`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/develocity/apis/develocity-api/docs/api/tests/containers/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the list of test containers.

## Query parameters

- `query` TestContainersQuery, required
  - `container` string: Allows restricting the search to parts of the test container hierarchy. You can use wildcards to match a specific subpackage.
  - `testOutcomes` TestOutcome[], required: Allows restricting the search to tests that had at least one instance of the given outcome.
  - `query` string, required: A query for filtering tests, written in the Develocity advanced search query language See: https://gradle.com/help/advanced-search
  - `include` TestIncludeFields[], nullable: Controls which optional fields are included in the response.

## Response `200`

A list of test containers.

- TestsResponse: A list of test containers or test cases.
  - `content` TestOrContainer[], required: A list of test containers.
    - `name` string, required: The name of the test or test container.
    - `workUnits` TestWorkUnit[], nullable
      - `bazel` BazelWorkUnit: A Bazel work unit.
        - `packageName` string, required: The name of the Bazel package.
        - `targetName` string, required: The name of the Bazel target.
      - `gradle` GradleWorkUnit: A Gradle work unit.
        - `projectName` string, required: The name of the Gradle project.
        - `taskPath` string, required: The path of the Gradle task.
      - `maven` MavenWorkUnit: A Maven work unit.
        - `groupId` string, required: The Maven groupId.
        - `artifactId` string, required: The Maven artifactId.
        - `goalName` string, required: The Maven goal name.
        - `executionId` string, required: The execution id of the goal.
      - `npm` NpmWorkUnit: An npm work unit.
        - `projectName` string, required: The name of the npm project.
        - `testRunner` string, required: The name of the test runner.
      - `sbt` SbtWorkUnit: An sbt work unit.
        - `scope` object: The sbt scope.
          - `project` string: The name of the sbt scope project.
          - `configuration` string: The name of the sbt scope configuration.
          - `task` string: The name of the sbt scope task.
        - `taskName` string, required: The name of the sbt task.
    - `outcomeDistribution` TestOutcomeDistribution, required: A distribution of outcomes.
      - `passed` integer, required: The number of 'Passed' outcomes.
      - `failed` integer, required: The number of 'Failed' outcomes.
      - `skipped` integer, required: The number of 'Skipped' outcomes.
      - `flaky` integer, required: The number of 'Flaky' outcomes.
      - `notSelected` integer, required: The number of 'Not Selected' outcomes.
      - `total` integer, required: The total number of outcomes.
    - `buildScanIdsByOutcome` BuildScanIdsByOutcome: Build Scan IDs for builds that contain tests with outcomes.
      - `passed` string[], required: The BuildIds of 'Passed' outcomes.
      - `failed` string[], required: The Build Scan IDs of 'Failed' outcomes.
      - `skipped` string[], required: The BuildIds of 'Skipped' outcomes.
      - `flaky` string[], required: The BuildIds of 'Flaky' outcomes.
      - `notSelected` string[], required: The BuildIds of 'Not Selected' outcomes.

## Other responses

- `400`: The request cannot be fulfilled due to a problem.
- `500`: The server encountered an unexpected error.

---

[API](https://skmtc.dev/develocity/apis/develocity-api.md) - [All operations](https://skmtc.dev/develocity/apis/develocity-api/llms.txt) - [OpenAPI document](https://skmtc.dev/develocity/apis/develocity-api/revisions/b49835fbf065?raw)
