-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use test materialization for schema/generic tests, update integration…
… tests
- Loading branch information
Kyle Wigley
committed
Apr 22, 2021
1 parent
33dc970
commit ac8cd78
Showing
31 changed files
with
70 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
test/integration/008_schema_tests_test/local_dependency/dbt_project.yml
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
test/integration/008_schema_tests_test/local_dependency/macros/equality.sql
This file was deleted.
Oops, something went wrong.
41 changes: 17 additions & 24 deletions
41
test/integration/008_schema_tests_test/macros-v2/macros/tests.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,35 @@ | ||
{% test every_value_is_blue(model, column_name) %} | ||
|
||
|
||
{% macro test_every_value_is_blue(model, column_name) %} | ||
|
||
select | ||
count(*) | ||
|
||
select * | ||
from {{ model }} | ||
where {{ column_name }} != 'blue' | ||
|
||
{% endmacro %} | ||
{% endtest %} | ||
|
||
|
||
{% macro test_rejected_values(model, column_name, values) %} | ||
|
||
select | ||
count(*) | ||
{% test rejected_values(model, column_name, values) %} | ||
|
||
select * | ||
from {{ model }} | ||
where {{ column_name }} in ( | ||
{% for value in values %} | ||
'{{ value }}' {% if not loop.last %} , {% endif %} | ||
{% endfor %} | ||
) | ||
|
||
{% endmacro %} | ||
{% endtest %} | ||
|
||
|
||
{% macro test_equivalent(model, value) %} | ||
{% test equivalent(model, value) %} | ||
{% set expected = 'foo-bar' %} | ||
select | ||
{% if value == expected %} | ||
0 | ||
{% else %} | ||
{% set msg -%} | ||
got "{{ value }}", expected "{{ expected }}" | ||
{%- endset %} | ||
{% do log(msg, info=True) %} | ||
1 | ||
{% set eq = 1 if value == expected else 0 %} | ||
{% set validation_message -%} | ||
'got "{{ value }}", expected "{{ expected }}"' | ||
{%- endset %} | ||
{% if eq == 0 and execute %} | ||
{{ log(validation_message, info=True) }} | ||
{% endif %} | ||
as id | ||
{% endmacro %} | ||
|
||
select {{ validation_message }} as validation_error | ||
where {{ eq }} = 0 | ||
{% endtest %} |
6 changes: 0 additions & 6 deletions
6
test/integration/008_schema_tests_test/macros-v2/malformed/tests.sql
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
test/integration/008_schema_tests_test/models-v2/custom-bad-test-macro/schema.yml
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
test/integration/008_schema_tests_test/models-v2/custom-bad-test-macro/table_copy.sql
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
test/integration/008_schema_tests_test/test-context-macros/custom_schema_tests.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{% macro test_type_one(model) %} | ||
{% test type_one(model) %} | ||
|
||
select count(*) from ( | ||
select * from ( | ||
|
||
select * from {{ model }} | ||
union all | ||
select * from {{ ref('model_b') }} | ||
|
||
) as Foo | ||
|
||
{% endmacro %} | ||
{% endtest %} | ||
|
||
{% macro test_type_two(model) %} | ||
{% test type_two(model) %} | ||
|
||
{{ config(severity = "WARN") }} | ||
|
||
select count(*) from {{ model }} | ||
select * from {{ model }} | ||
|
||
{% endmacro %} | ||
{% endtest %} |
Oops, something went wrong.