diff --git a/integration_tests/models/schema.yml b/integration_tests/models/schema.yml index 491de1c..ac642bd 100644 --- a/integration_tests/models/schema.yml +++ b/integration_tests/models/schema.yml @@ -225,7 +225,7 @@ models: to: ref('supplier') field: s_suppkey tests: - - dbt_constraints.unique_key: + - dbt_constraints.primary_key: column_names: - ps_partkey - ps_suppkey diff --git a/macros/create_constraints.sql b/macros/create_constraints.sql index f175036..7b7e9dd 100644 --- a/macros/create_constraints.sql +++ b/macros/create_constraints.sql @@ -172,6 +172,9 @@ and res.node.config.materialized == "test" and res.node.test_metadata and res.node.test_metadata.name is in( constraint_types ) + and res.failures == 0 + and res.node.config.error_if == '!= 0' + and res.node.config.warn_if == '!= 0' and res.node.config.where is none -%} {%- set test_model = res.node -%}