# dbt test

> Run the contract-managed dbt tests that `datacontract dbt sync` generated.

# `datacontract dbt test`

{/* AUTOGENERATED from `datacontract --help`: do not edit by hand; regenerate with update_command_docs.py */}

Run the contract-managed dbt tests that `datacontract dbt sync` generated. Runs `dbt test` scoped to the specified data contract(s), reports the results, and optionally publishes them. Use `datacontract dbt sync` to create and update the tests first.

```bash
datacontract dbt test [OPTIONS] [CONTRACT]...
```

| Argument | Default | Description |
|---|---|---|
| `[CONTRACT]...` | — | Path(s) or glob(s) of ODCS contracts to test. If omitted, tests every `*.odcs.yaml` under --project-dir (default: current directory) and its subdirectories. |

| Option | Default | Description |
|---|---|---|
| `--project-dir` | — | Path to the dbt project root (must contain `dbt_project.yml`). Defaults to the current directory. |
| `--target` | — | Forwarded to `dbt test --target`. |
| `--profiles-dir` | — | Forwarded to `dbt test --profiles-dir`. |
| `--publish` | — | The url to publish the results after the test. |
| `--server` | — | Selected ODCS server, used as the server label when publishing results. Default: Auto-selected if only one server exists, else --target. |
| `--ssl-verification` / `--no-ssl-verification` | `--ssl-verification` | SSL verification when publishing test results. |
| `--debug` / `--no-debug` | — | Enable debug logging |

```bash
datacontract dbt test orders.odcs.yaml --project-dir ./warehouse
```
