-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADAP-850: Support test results as a view #8653
Merged
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
718b892
add strategy parameter to TestConfig, default to ephemeral, catch str…
mikealfare d4dfec8
changie
mikealfare e999ed2
create test results as views
mikealfare f5e0797
removed unnecessary formatting changes
mikealfare 8e366bb
removed unnecessary formatting changes
mikealfare 1a3bd81
removed unnecessary formatting changes
mikealfare 7b4be33
removed unnecessary formatting changes
mikealfare a149d66
removed unnecessary formatting changes
mikealfare 0313904
removed unnecessary formatting changes
mikealfare ccf199c
removed unnecessary formatting changes
mikealfare f76fc74
removed unnecessary formatting changes
mikealfare 9a0656f
updated test expected values for new config option
mikealfare 40b646b
break up tests into reusable tests and adapter specific configuration…
mikealfare 661c5f6
use built-in utility to test relation types, reduce configuration to …
mikealfare 3fa0858
move configuration into base test class
mikealfare 49b797e
separate setup and teardown methods, move postgres piece back into db…
mikealfare 069a9b2
shorten inserted record values to avoid data type issues in the model…
mikealfare 61d514b
shorten inserted record values to avoid data type issues in the model…
mikealfare beb0ed4
add audit schema suffix as class attribute
mikealfare 5aa2031
rename `strategy` parameter to `store_failures_as`; allow `store_fail…
mikealfare 9971be7
updated changelog entry to reflect correct parameters
mikealfare 3ddc7d4
updated changelog entry to reflect correct parameters
mikealfare 4b81e22
revert unexpected formatting changes from black
mikealfare 0833774
revert test debugging artifacts
mikealfare eb1f3b4
update local variable to be more intuitive
mikealfare cf86565
update default for store_test_failures_as; rename postgres test to re…
mikealfare 2f1aa91
remove duplicated default for store_failures_as
mikealfare 96d18a9
update expected test config dicts to include the new default value fo…
mikealfare c214595
Merge branch 'main' into feature/materialized-tests/adap-850
mikealfare 0baf090
Add `store_failures_as` config for generic tests
dbeatty10 1b1d9c6
revert code to prioritize store_failures_as over store_failures
mikealfare 6c93e34
cover --store-failures on CLI gap
mikealfare a47e59e
add generic tests test case for store_failures_as
mikealfare 86b2793
Merge branch 'main' into feature/materialized-tests/adap-850
mikealfare 90792e0
Merge branch 'dbeatty/config-test-materializations-2' into feature/ma…
mikealfare c09b81d
update object names for generic test case tests for store_failures_as
mikealfare 729d939
remove unique generic test, it was not testing `store_failures_as`
mikealfare 9d3fb06
pull generic run and assertion into base test class to turn tests int…
mikealfare e70dca3
add ephemeral option for store_failures_as, as a way to easily turn o…
mikealfare 8b8f9bb
add compilation error for invalid setting of store_failures_as
mikealfare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,6 @@ | ||
kind: Features | ||
body: Support storing test failures as views | ||
time: 2023-09-15T17:44:28.833877-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "6914" |
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
150 changes: 150 additions & 0 deletions
150
tests/adapter/dbt/tests/adapter/store_test_failures_tests/_files.py
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,150 @@ | ||
SEED__CHIPMUNKS = """ | ||
name,shirt | ||
alvin,red | ||
simon,blue | ||
theodore,green | ||
dave, | ||
""".strip() | ||
|
||
|
||
MODEL__CHIPMUNKS = """ | ||
{{ config(materialized='table') }} | ||
select * | ||
from {{ ref('chipmunks_stage') }} | ||
""" | ||
|
||
|
||
TEST__VIEW_TRUE = """ | ||
{{ config(store_failures_as="view", store_failures=True) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__VIEW_FALSE = """ | ||
{{ config(store_failures_as="view", store_failures=False) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__VIEW_UNSET = """ | ||
{{ config(store_failures_as="view") }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__TABLE_TRUE = """ | ||
{{ config(store_failures_as="table", store_failures=True) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__TABLE_FALSE = """ | ||
{{ config(store_failures_as="table", store_failures=False) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__TABLE_UNSET = """ | ||
{{ config(store_failures_as="table") }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__EPHEMERAL_TRUE = """ | ||
{{ config(store_failures_as="ephemeral", store_failures=True) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__EPHEMERAL_FALSE = """ | ||
{{ config(store_failures_as="ephemeral", store_failures=False) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__EPHEMERAL_UNSET = """ | ||
{{ config(store_failures_as="ephemeral") }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__UNSET_TRUE = """ | ||
{{ config(store_failures=True) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__UNSET_FALSE = """ | ||
{{ config(store_failures=False) }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__UNSET_UNSET = """ | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
TEST__VIEW_UNSET_PASS = """ | ||
{{ config(store_failures_as="view") }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'purple' | ||
""" | ||
|
||
|
||
TEST__ERROR_UNSET = """ | ||
{{ config(store_failures_as="error") }} | ||
select * | ||
from {{ ref('chipmunks') }} | ||
where shirt = 'green' | ||
""" | ||
|
||
|
||
SCHEMA_YML = """ | ||
version: 2 | ||
|
||
models: | ||
- name: chipmunks | ||
columns: | ||
- name: name | ||
tests: | ||
- not_null: | ||
store_failures_as: view | ||
- accepted_values: | ||
store_failures: false | ||
store_failures_as: table | ||
values: | ||
- alvin | ||
- simon | ||
- theodore | ||
- name: shirt | ||
tests: | ||
- not_null: | ||
store_failures: true | ||
store_failures_as: view | ||
""" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇