-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: implement initial testing framework
- Loading branch information
Showing
6 changed files
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# compiled code & logs | ||
**/target/ | ||
**/logs/ | ||
# package folder | ||
**/dbt_packages/ | ||
# dbt folders that are not used | ||
**/snapshots/ | ||
**/analysis/ | ||
**/data/ | ||
# user specific file | ||
**/.user.yml | ||
|
||
# MacOS specific files | ||
.DS_Store |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: 'pm_utils_integration_tests' | ||
version: '1.0.0' | ||
config-version: 2 | ||
|
||
profile: 'integration_tests' |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% test equal_value(model, actual, expected) %} | ||
select * from {{ model }} where {{ actual }} != {{ expected }} | ||
{% endtest %} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: test_concat | ||
tests: | ||
- equal_value: | ||
actual: '"Two_text_fields"' | ||
expected: '"Two_text_fields_expected"' | ||
- equal_value: | ||
actual: '"One_null"' | ||
expected: '"One_null_expected"' |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
with Input_data as ( | ||
select | ||
'A' as "Column_A", | ||
'B' as "Column_B", | ||
null as "Column_C" | ||
) | ||
|
||
select | ||
{# Concatenate two text fields (basic scenario) #} | ||
{{ pm_utils.concat('"Column_A"', '"Column_B"') }} as "Two_text_fields", | ||
'AB' as "Two_text_fields_expected", | ||
|
||
{# Concatenate two fields of which one is null #} | ||
{{ pm_utils.concat('"Column_A"', '"Column_C"') }} as "One_null", | ||
'A' as "One_null_expected" | ||
from Input_data |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
packages: | ||
- local: ../ |