-
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
Support disabling unit tests #10831
Support disabling unit tests #10831
Conversation
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @tsturge |
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10831 +/- ##
==========================================
- Coverage 89.19% 89.13% -0.07%
==========================================
Files 183 183
Lines 23496 23508 +12
==========================================
- Hits 20958 20953 -5
- Misses 2538 2555 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @tsturge |
I like this. Especially because the unit tests are now broken when we have ctx like vars inside the model. The way I was handling this was by commenting them out. |
Also, when a model is disabled, disable the corresponding unit tests automatically. (#10540)
aec0aba
to
56f2300
Compare
Hi! I was eagerly waiting for this to be released. I saw that this PR was merged 3 weeks ago. A new dbt-core version (1.8.9) was released one week ago but this feature doesn't seem to work there yet. This unit test: version: 2
unit_tests:
- name: consolidate_gmv_currencies
config:
enabled: false
model: validate_consolidate_gmv_currencies gets still listed by Am I missing something? Thanks |
@maxmarcon the changes in this PR weren't included in 1.8.9, but they are included in 1.9.0. I've tested out disabling them as you have above, and it's working for me. |
While explicitly disabling a unit test using the below code is working:
I'm still getting parsing errors when a model is disabled and a unit test is not explicitly disabled:
Whether I have the model disabled using conditional logic such as It seems like the unit test should be disabled in this situation based on the changes made in I'm testing this out on dbt-core v1.9.0 and dbt-bigquery v1.9.0. Please let me know if I'm doing something wrong - thanks! |
Support config: disabled for unit tests. (#9109)
Also, when a model is disabled, disable the corresponding unit tests automatically. (#10540)
Problem
config:
enabled: false
Solution
Check for the config: enabled variable while parsing the unit test. If it is set to false, mark the unit test as disabled.
Checklist