You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the outcome of the spike+ #8799. Exact details of what input should look like can be found there.
Outcomes of the spike
We need to patch unit-tests to be able to determine what versions of a model exist since versions are defined in the schema files and schema files are parsed at the end. This is largely done in spike unit test versions #9302.
There will still only be one unit test node, even though we may be executing multiple unit tests. The versioned models that the unit test can run against will be listed in the depends_on of the UnitTestDefinition
We may need to do something similar to what @gshank did in the build command here, where there are two 'selected' lists, one with unit tests and one without, but we would need two selection lists, one with models and one without (in order to account for run results)
Acceptance criteria
A unit test definition can define the model versions to include or exclude from a test
If no versions are defined in the unit test definition, but the target model is versioned, a unit test will be run for all versions of the model
When dbt build is run with a select for a versioned model, only the unit test for that specific model version will run, even if no version is defined in the schema file
When a command selects on a unit test that is for a versioned model, unit tests for all versions of that model will be run
Impact to Other Teams
no
Will backports be required?
no
Context
Suggested Tests
test with no version specified, should create a separate unit test for each version
with with an exclude version specified, should create a separate unit test for each version except the excluded version
test with an include version specified, should create a single unit test for only the version specified
test with an include and exclude version specified, should get ValidationError
test with an include for an unversioned model, should error
partial parsing test: test with no version specified, then add an exclude version, then switch to include version and make sure the right unit tests are generated for each
test with no version specified in the schema file and use selection logic on a versioned model for a specific version
test with no version specified in the schema file and use selection logic on a unit test - expect unit tests for all versioned models
test specifying the fixture version with {{ ref(name, version) }}
The text was updated successfully, but these errors were encountered:
After discussing internally, we've decided we are not ok with this funky behavior.
We are going to try again with making one node per unit test run (instead of bundling them together). This is consistent with how we treat data tests that are configured on a model with multiple versions.
Example: a uniqueness test with a versioned model.
Note where it says “2 tests” and that it shows those 2 tests.
If we are unable to overcome the partial parsing issues with the above solution, we will have a known restriction that you can only apply 1 unit test per model version. We will then not allow folks to specify multiple versions of a model that unit test to apply to. If no version is specified, we will use the latest version.
Housekeeping
Short description
This is the outcome of the spike+ #8799. Exact details of what input should look like can be found there.
Outcomes of the spike
depends_on
of theUnitTestDefinition
Acceptance criteria
dbt build
is run with a select for a versioned model, only the unit test for that specific model version will run, even if no version is defined in the schema fileImpact to Other Teams
no
Will backports be required?
no
Context
Suggested Tests
The text was updated successfully, but these errors were encountered: