> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# tests.json

> Learn how to write the `tests.json` config for your project

The `tests.json` file allows you to specify your Openlayer tests.

This allows you to fully control your project's tests with a single configuration file that
can be version-controlled, without needing to use the Openlayer UI to create and update tests.

This guide shows how you can write the `tests.json` for your project.

## Discoverability

First, it is important to signal to Openlayer that you have a test configuration file.

You can do so in the [testsPath](/development/openlayer-json#testspath) field of your [openlayer.json](/development/openlayer-json).
Make sure that you point to your `tests.json` file, as in:

```json openlayer.json theme={null}
{
  "testsPath": "tests.json",
  ...
}
```

## Structure

The `tests.json` file should contain an `array` of `Test` objects, each representing
a test in your project.

The `Test` objects have a set of **common attributes** and a set of attributes that
**depend on the `mode`** (i.e., if it is a development test or monitoring test).

<Tip>
  The best way to write a test configuration is to **copy the examples** from
  the [documentation](/tests/overview) and edit them to fit your use case. Each
  test has a documentation page with information about it and configuration
  examples. They are all listed [here](/tests/overview).
</Tip>

### `Test` object common attributes

The common attributes must always be present, regardless of the `mode`.

#### `name`

**Type**: `string`, required

The test name.

#### `description`

**Type**: `string`.

The test description.

#### `type`

**Type**: `string`, required.

The test type, which represents the test category. Must be one of `integrity`, `consistency`, or `performance`.

#### `subtype`

**Type**: `string`, required.

The test subtype, which identifies the test on the platform. Must be one of the valid `subtypes`.

#### `thresholds`

**Type**: `array` of `Threshold` objects, required.

The thresholds that

<Accordion title="Threshold object attributes">
  #### `insightName`

  **Type**: `string`, required.

  Name of the insight from which the test is based. Must be one of the valid insight names.

  ***

  #### `measurement`

  **Type**: `string`, required.

  Key from the `insightName` on top of which the threshold will be applied. Must be one of the valid measurement names.

  ***

  #### `operator`

  **Type**: `string`, required.

  Operator used to compare the `measurement` and `value`. Must be one of `is`, `>`, `>=`, `<`, `<=`.

  ***

  #### `value`

  **Type**: `number | string`, required.

  Threshold value.

  ***

  #### `insightParameters`

  **Type**: `object`.

  Parameters needed to compute the insight. Might be `null` depending on the insight.
</Accordion>

#### `subpopulationFilters`

**Type**: `object`.

Filters that define the subpopulation.

#### `syncId`

**Type**: `string`, required.

An id (UUID) that identifies the test.

#### `mode`

**Type**: `string`, required.

Defines to which mode the test applies to. Must be one of `development` or `monitoring`.

### `Test` object mode-specific attributes

The additional attributes you must specify for a test depend on its `mode`, i.e., if it is a
`development` or `monitoring` mode test.

<Tabs>
  <Tab title="development">
    #### `usesValidationDataset`

    **Type**: `bool`, required

    Indicates if the test uses the validation dataset.

    #### `usesTrainingDataset`

    **Type**: `bool`, required

    Indicates if the test uses the training dataset.

    #### `usesMlModel`

    **Type**: `bool`, required

    Indicates if the test uses model.
  </Tab>

  <Tab title="monitoring">
    #### `evaluationWindow`

    **Type**: `integer`, required

    The test [evaluation window](/monitoring/evaluation-and-delay-windows#evaluation-windows), in hours.

    #### `delayWindow`

    **Type**: `integer`, required, default `0`.

    The test [delay window](/monitoring/evaluation-and-delay-windows#delay-windows), in hours.
  </Tab>
</Tabs>
