# List quarantined tests

Source: https://docs.coderhelm.com/api/reference/ci/list-quarantined-tests

`GET /webhooks/ci/tests/quarantine`

Returns the tests quarantined for the repository the OIDC token was issued to, so a CI step can keep their failures from failing the build. For Playwright, pass `playwright_grep_invert` to `--grep-invert`.

## Authentication

A GitHub Actions OIDC token requested with the audience `coderhelm`, as `Authorization: Bearer <token>`. See [Authentication](https://docs.coderhelm.com/api/authentication#ci-jobs).

## Responses

### 200

The quarantined tests.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `playwright_grep_invert` | string | yes | A pattern for Playwright's `--grep-invert` that skips them; empty when none are. |
| `tests` | array of QuarantinedTest | yes | Every quarantined test. |
| `tests[].file` | string | yes | Its file. |
| `tests[].framework` | string | yes | `playwright`, `cucumber` or `junit`. |
| `tests[].id` | string | yes | CoderHelm's id for the test. |
| `tests[].project` | string or null | no | The Playwright project, when there is one. |
| `tests[].title` | string | yes | Its title, `describe › title`. |

### 401

The token is not a valid GitHub Actions OIDC token for CoderHelm.

### 403

The repository is not connected, or E2E results are off.

## Example request

cURL:

```bash
curl -X GET 'https://api.coderhelm.com/webhooks/ci/tests/quarantine' \
  -H "Authorization: Bearer $OIDC_TOKEN"
```

TypeScript:

```ts
const res = await fetch("https://api.coderhelm.com/webhooks/ci/tests/quarantine", {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.OIDC_TOKEN}`,
  },
});
if (!res.ok) {
  const { error, code } = await res.json();
  throw new Error(`${res.status} ${code}: ${error}`);
}
const data = await res.json();
```

Python:

```python
import os
import requests

headers = {
    "Authorization": f"Bearer {os.environ['OIDC_TOKEN']}",
}
res = requests.request("GET", "https://api.coderhelm.com/webhooks/ci/tests/quarantine", headers=headers)
if not res.ok:
    raise RuntimeError(f"{res.status_code}: {res.json().get('error')}")
data = res.json()
```

## Example response

```json
{
  "playwright_grep_invert": "checkout applies a discount code",
  "tests": [
    {
      "file": "e2e/checkout.spec.ts",
      "framework": "playwright",
      "id": "e2e/checkout.spec.ts::checkout › applies a discount code",
      "project": "chromium",
      "title": "checkout › applies a discount code"
    }
  ]
}
```
