-
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
[CT-3122] [spike] explore testing command options to understand technical complexities and determine best option #8651
Comments
Considerations from estimation:
Why not pursue (3)? Scope of this spike:
Preference from engineering is for option (3). If that's the choice, we do not need a spike. |
Acceptance criteria:dbt test
dbt build
The question for both is ... what is the mechanism to specify which types of tests to run
Open question: Are we planning to support different flags for unit tests vs. data tests? Or will we have the same flags for both? What to do about the test_type method
I believe our two "test types" are unit tests and data tests. We could: |
Notes from refinement:
|
Option 2 |
Can we just add Users can then use selectors to specify whether they want unit tests, data tests, or both; similar to |
@aranke How would users select that they want only unit tests or data tests to run? Via |
the unit testing squad had a great discussion today on “what should the mechanism be to select only unit tests or only data test to run” and have narrowed it down to 2 main options:
Example scenarios:“i need to run my unit tests” - likely in development “i need to run all of my tests” - likely in development & CI “i need to run just my data tests” - likely in production “i need to build everything except my unit tests” - likely in production “i need to build everything” - likely in CI some additional considerationsfor option 1:
for option 2:
|
After some discussion with dbt users - we're going to move forward with option 2: unit tests and data tests are types of tests that can be selected using
Thanks for weighing in here! I'll go ahead and close this out and open up some implementation ticket(s):
|
Housekeeping
Short description
As discussed in this issue, as we expand our test coverage we need to rethink our testing commands to ensure clarity and usability. We will have 2 types of tests in dbt:
We have a few options for the associated commands:
dbt test —-unit
anddbt test —-data
dbt test unit
anddbt test data
dbt unit-test
anddbt data-test
dbt test --select test_type:unit
anddbt test --select test_type:data
We would also need to decide what happens to the legacy
dbt test
anddbt build
commands:Options for
dbt test
:dbt test
runs all of your tests (both unit and data)dbt test
is an alias fordbt test —-data
(or whichever option we go with above); only runs data testsOptions for
dbt build
:dbt build
runs all of your tests (both unit and data), and we provide a way to just run one type of test likedbt build --unit
anddbt build --data
dbt build
only runs data testsWhile 2 might more accurately maintain legacy
dbt test/build
behavior, this wouldn't actually be behavior change right away, because no one will have unit tests defined in their projects.1, on the other hand, would be simpler to explain and makes it clear that these things are both "tests".
We would recommend as a Best Practice that you should exclude unit tests from production runs, sorta like how we recommend that you exclude unchanged views: https://docs.getdbt.com/docs/cloud/billing#build-only-changed-views.
This may impact the "test type" and "test name" selection methods. I'd be inclined to get rid of the test_type selection method, as they aren't actually "types" more just methods of implementing data tests (there are also other ways to achieve this selection whether via tags or file_path).
There may be technical complexities with each of these options, so we should spike investigating them as options to decide the best past forward.
From @MichelleArk
Acceptance criteria
We understand the complexities of each of the command options and have determined the best path forward. See expanded acceptance criteria in comment below.
Impact to Other Teams
None
Will backports be required?
None
Context
No response
The text was updated successfully, but these errors were encountered: