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

# Adding test suites through the UI

# Adding Test Suites Through the UI

Test Suites are logical container allowing you to group related Test Cases together from different tables. This is a great way to group related test cases together and set a single alert for test case failure.
**Note:** you will need to make sure you have the right permission in OpenMetadata to create a test.

## Step 1: Creating a Test Suite

From the vertical navigation bar, click on `Quality icon > Data Quality` and navigate to the `By Test Suites` tab. From there click on `Add Test Suite` button on the top right corner.

<img src="https://mintcdn.com/openmetadata/oaTZzo76cVYQrwnS/public/images/features/ingestion/workflows/data-quality/profiler-tab-view.png?fit=max&auto=format&n=oaTZzo76cVYQrwnS&q=85&s=06b88e04164ea3d31a98a7872aafef94" alt="Write your first test" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/data-quality/profiler-tab-view.png" />

On the next page, enter the name and description (optional) of your test suite.

<img src="https://mintcdn.com/openmetadata/cpYhk0oyurO_-Qc1/public/images/features/ingestion/workflows/data-quality/test-suite-page.png?fit=max&auto=format&n=cpYhk0oyurO_-Qc1&q=85&s=bb41191bc5f750b91892e17e73407927" alt="Create test suite" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/data-quality/test-suite-page.png" />

## Step 2: Add Test Cases

On the next page, you will be able to add existing test cases from different entity to your test suite. This allows you to group together test cases from different entities

**Note:** Test Case name needs to be unique across the whole platform. A warning message will show if your Test Case name is not unique.

<img src="https://mintcdn.com/openmetadata/cpYhk0oyurO_-Qc1/public/images/features/ingestion/workflows/data-quality/test-case-page.png?fit=max&auto=format&n=cpYhk0oyurO_-Qc1&q=85&s=b361fe45a00089862dc3906070872bfe" alt="Create test case" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/data-quality/test-case-page.png" />

## Data Quality

### Adding Data Quality Test Cases from yaml config

When creating a JSON config for a test workflow the source configuration is very simple.

```yaml theme={null}
source:
  type: TestSuite
  serviceName: <your_service_name>
  sourceConfig:
    config:
      type: TestSuite
      entityFullyQualifiedName: <entityFqn>
```

The only sections you need to modify here are the `serviceName` (this name needs to be unique) and `entityFullyQualifiedName` (the entity for which we'll be executing tests against) keys.

Once you have defined your source configuration you'll need to define te processor configuration.

```yaml theme={null}
processor:
  type: "orm-test-runner"
  config:
    forceUpdate: <false|true>
    testCases:
      - name: <testCaseName>
        testDefinitionName: columnValueLengthsToBeBetween
        columnName: <columnName>
        parameterValues:
          - name: minLength
            value: 10
          - name: maxLength
            value: 25
      - name: <testCaseName>
        testDefinitionName: tableRowCountToEqual
        parameterValues:
          - name: value
            value: 10
```

The processor type should be set to ` "orm-test-runner"`. For accepted test definition names and parameter value names refer to the [tests page](/how-to-guides/data-quality-observability/quality/tests-yaml).

<Tip>
  Note that while you can define tests directly in this YAML configuration, running the
  workflow will execute ALL THE TESTS present in the table, regardless of what you are defining in the YAML.

  This makes it easy for any user to contribute tests via the UI, while maintaining the test execution external.
</Tip>

You can keep your YAML config as simple as follows if the table already has tests.

```yaml theme={null}
processor:
  type: "orm-test-runner"
  config: {}
```

### Key reference:

* `forceUpdate`: if the test case exists (base on the test case name) for the entity, implements the strategy to follow when running the test (i.e. whether or not to update parameters)
* `testCases`: list of test cases to add to the entity referenced. Note that we will execute all the tests present in the Table.
* `name`: test case name
* `testDefinitionName`: test definition
* `columnName`: only applies to column test. The name of the column to run the test against
* `parameterValues`: parameter values of the test

The `sink` and `workflowConfig` will have the same settings as the ingestion and profiler workflow.

### Full  `yaml` config example

```yaml theme={null}
source:
  type: TestSuite
  serviceName: MyAwesomeTestSuite
  sourceConfig:
    config:
      type: TestSuite
      entityFullyQualifiedName: MySQL.default.openmetadata_db.tag_usage
#     testCases: ["run_only_this_test_case"] # Optional, if not provided all tests will be executed

processor:
  type: "orm-test-runner"
  config:
    forceUpdate: false
    testCases:
      - name: column_value_length_tagFQN
        testDefinitionName: columnValueLengthsToBeBetween
        columnName: tagFQN
        parameterValues:
          - name: minLength
            value: 10
          - name: maxLength
            value: 25
      - name: table_row_count_test
        testDefinitionName: tableRowCountToEqual
        parameterValues:
          - name: value
            value: 10

sink:
  type: metadata-rest
  config: {}
workflowConfig:
  openMetadataServerConfig:
    hostPort: <OpenMetadata host and port>
    authProvider: <OpenMetadata auth provider>
```

### How to Run Tests

To run the tests from the CLI execute the following command

```
metadata test -c /path/to/my/config.yaml
```
