Skip to main content

datacontract dbt test

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.

datacontract dbt test [OPTIONS] [CONTRACT]...
ArgumentDefaultDescription
[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.
OptionDefaultDescription
--project-dirPath to the dbt project root (must contain dbt_project.yml). Defaults to the current directory.
--targetForwarded to dbt test --target.
--profiles-dirForwarded to dbt test --profiles-dir.
--publishThe url to publish the results after the test.
--serverSelected 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-verificationSSL verification when publishing test results.
--debug / --no-debugEnable debug logging
datacontract dbt test orders.odcs.yaml --project-dir ./warehouse