Skip to main content

datacontract test

Run schema and quality tests on configured servers.

datacontract test [OPTIONS] [LOCATION]
ArgumentDefaultDescription
[LOCATION]datacontract.yamlThe location (url, s3 url, or local path) of the data contract yaml.
OptionDefaultDescription
--json-schemaThe location (url or path) of the ODCS JSON Schema
--serverallThe server configuration to run the schema and quality tests. Use the key of the server object in the data contract yaml file to refer to a server, e.g., production, or all for all servers (default).
--schema-nameallWhich schema to test, e.g., orders, or all for all schemas (default).
--publish-test-results / --no-publish-test-results--no-publish-test-resultsDeprecated. Use publish parameter. Publish the results after the test
--publishThe url to publish the results after the test.
--outputSpecify the file path where the test results should be written to (e.g., './test-results/TEST-datacontract.xml').
--output-formatThe target format for the test results. Accepted values: json, junit.
--checksComma-separated list of check categories to run (available: schema, quality, servicelevel, custom). Omit to enable all.
--dimensionComma-separated list of quality dimensions to run (available: accuracy, completeness, conformity, consistency, coverage, timeliness, uniqueness). Runs the quality rules declaring a matching dimension, plus the schema and service level checks that measure it. Omit to run everything.
--quality-idComma-separated list of quality rule ids to run, as defined in the id of the quality rule. Runs only those rules, no schema or service level checks. Fails if an id is not defined in the data contract. Omit to run everything.
--tagComma-separated list of tags to run. Runs the quality rules declaring a matching tag in their tags, no schema or service level checks. Omit to run everything.
--filterA SQL predicate to filter the rows under test, in the dialect of the server, e.g., "ingested_at >= CURRENT_DATE - 1". Only works if a single schema is tested; for contracts with multiple schemas, combine with --schema-name or use --filters. Schema checks and custom SQL queries are not filtered.
--filtersRow filters per schema, as a JSON object mapping schema name to SQL predicate, e.g., '{"orders": "ingested_at >= CURRENT_DATE - 1"}'. Schema checks and custom SQL queries are not filtered.
--include-failed-samples / --no-include-failed-samples--no-include-failed-samplesCollect a small sample of rows that failed each missing/invalid/duplicate check (identifier + offending columns; sensitive columns omitted). Off by default.
--logs / --no-logs--no-logsPrint logs
--ssl-verification / --no-ssl-verification--ssl-verificationSSL verification when publishing the data contract.
--inline-references / --no-inline-references--inline-referencesResolve external references (currently: authoritativeDefinitions[type in {definition, semantics}]) in the contract and inline the fetched content from the configured entropy-data host.
--debug / --no-debugEnable debug logging
datacontract test datacontract.yaml --server production

Guide: Test your Data.