diff --git a/integration-tests/macros/macro_with_ref.sql b/integration-tests/macros/macro_with_ref.sql new file mode 100644 index 0000000..af0a716 --- /dev/null +++ b/integration-tests/macros/macro_with_ref.sql @@ -0,0 +1,3 @@ +{% macro macro_with_ref() %} + {% set dummy = dbt_unit_testing.ref('model_a') %} +{% endmacro %} diff --git a/macros/tests.sql b/macros/tests.sql index 1bb6752..7d24114 100644 --- a/macros/tests.sql +++ b/macros/tests.sql @@ -177,7 +177,7 @@ {% endmacro %} {% macro running_unit_test() %} - {{ return (config.get('tags') and 'unit-test' in config.get('tags')) }} + {{ return ('unit-test' in config.get('tags', {})) }} {% endmacro %} {% macro ref_tested_model(model_name) %} diff --git a/run-integration-tests.sh b/run-integration-tests.sh index 4d10f42..8a3ab22 100755 --- a/run-integration-tests.sh +++ b/run-integration-tests.sh @@ -16,6 +16,8 @@ if [[ ! -e ~/.dbt/profiles.yml ]]; then cp ci/profiles.yml ~/.dbt/profiles.yml fi +dbt run-operation macro_with_ref --target "$PROFILE" + dbt deps --target "$PROFILE" # create seeds in the database