Test a Data Contract
Testing runs a data contract's data quality rules against the real data behind its output port and records the result — so you and your consumers know the data still meets the contract.
Run tests in the UI
- Open the data contract.
- In the Data Quality section, click Run Data Contract Test. If the contract has more than one server, first pick the server under for server.
Entropy Data runs the contract's checks against the server. The outcome appears in the contract's Data Quality section: how many checks passed or failed, the server that was tested, and when it last ran.

You can also see results in the Tests view of the Data Contract Editor.
Tests run on demand only: Entropy Data does not run them on a schedule. To test regularly, run the Data Contract CLI from a scheduler or your CI/CD pipeline.
The button is shown when:
- in-app testing is set up for the organization (see Set up in-app testing),
- the contract is an ODCS data contract with at least one server,
- the contract carries one of the organization's testing tags, if any are configured, and
- you have the
DATACONTRACT_TEST_RUNpermission on the contract's team.
Otherwise the Data Quality section explains what is missing:
| Message | What to do |
|---|---|
| "To enable on-demand data quality testing, you can deploy the Data Contract CLI as server." | Testing is not set up for the organization. Organization owners see an Enable button that opens the settings. See Set up in-app testing. |
| "This contract does not have the necessary tags set to enable data contract tests." | Add one of the organization's testing tags to the data contract. Organization owners see a See tags button that shows them. |
| "This data contract has no server configured." | Add a server to the data contract with Add server information. |
The same test can be started through the API with POST /api/datacontracts/{id}/test?server=<server>, or POST /api/datacontracts/{id}/branches/{branch}/test for a branch. It needs a key with the DATACONTRACT_TEST_RUN permission. The testing tags do not apply to the API.
Set up in-app testing
Entropy Data does not connect to your data platform itself to run tests. It sends the contract to a Data Contract CLI that runs as an API server (datacontract api), and that server runs the checks and returns the results. Because the CLI server opens the connection to your data, you run it where it can reach your data platform, and you give it the credentials there.
-
Deploy the Data Contract CLI as an API server. See the Data Contract CLI API documentation.
-
Configure the credentials for your data platforms as environment variables of the CLI server, for example
DATACONTRACT_SNOWFLAKE_USERNAMEandDATACONTRACT_SNOWFLAKE_PASSWORD. Entropy Data never sends data platform credentials. -
As an organization owner, open Settings → Data Quality → Data Contract Testing.
-
Fill in the settings:
Field Description Data Contract CLI API Endpoint The URL of the CLI server. Required. Entropy Data posts the contract to <endpoint>/test.API Key Optional. Sent as the x-api-keyheader, if the CLI server is protected with one. Leave the field empty to keep the current key.Enable Data Contract Tests Switch testing on. Without it, the Run Data Contract Test button is not shown. Tags Optional. If you add tags, only data contracts that carry one of them can be tested in the UI. Without tags, every data contract can be tested. -
Click Test Connection to check that Entropy Data can reach the CLI server, then save.
For each test, Entropy Data sends the contract with its servers and definitions inlined. It also sends its own host and a read-only API key as the entropy-data-host and entropy-data-api-key headers, so the CLI can read definitions and semantic concepts that the contract references. Entropy Data creates that key on first use, as an organization API key named Data Contract Tests, and replaces it if it is deleted or expires.
Test with the Data Contract CLI
The Data Contract CLI (datacontract test) runs the same checks locally or in a pipeline and publishes the results back to Entropy Data. Each contract's How to test section shows a ready-made command with the right URL and server. The general shape:
# Authenticate to Entropy Data
export ENTROPY_DATA_API_KEY=<your-api-key>
# Credentials for the data source (example: Snowflake)
export DATACONTRACT_SNOWFLAKE_USERNAME=<username>
export DATACONTRACT_SNOWFLAKE_PASSWORD=<password>
export DATACONTRACT_SNOWFLAKE_WAREHOUSE=<warehouse>
export DATACONTRACT_SNOWFLAKE_ROLE=<role>
datacontract test https://<your-entropy-data-host>/<org>/datacontracts/<contract-id> \
--server <server> \
--publish <publish-url>
<server> is the server defined in the contract to test against; --publish uploads the results to Entropy Data. Create the API key under your organization settings — it must be associated with a user.
To test a branch of the contract rather than the contract itself, read the branch's document from /api/datacontracts/<contract-id>/branches/<branch>/datacontract.yaml and name the branch in the uploaded result ("branch": "<branch>"). The run then shows on the branch page only and never counts for the contract.
Test in CI/CD
Run datacontract test on every change so breaking changes are caught before they reach consumers. See CI/CD.