-
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
test coverage #589
Comments
As a first iteration I think it should just spit out basic percentages:
Then you could start to break it down by test type (null, unique, and then custom). Along with this, I would love to see a severity / type config for tests. We have some "freshness" tests on data we're pulling from Google Sheets. I'd love to just warn that it's not passing on those tests instead of failing. @drewbanin let me know if this warrants a separate issue. |
@tayloramurphy i like that but even one step further. The main reason for test coverage statistics is to know where the most vulnerable parts of the code are. I think summary statistics like "X% of tables have a test" is good but I also need to know specifically what tests exist for what models. For instance (with a
I can immediately understand that our base_sfdc model has 3 schema tests and 2 custom tests and that base_zendesk has 1 schema test and no custom tests. I also agree with being able to break it down by type of test, as that will be vital for determining the quality of the tests. Another pipe dream is also having a strict dbt mode where models without tests can't be run |
Check out the This wasn't implemented in our first-pass, but I think something like that is a really good idea, and we now have an obvious place for it. I like the idea of warning vs. failure, and I've also thought about some sort of |
i was thinking strict in terms of @drewbanin sounds like a plan 👍 |
for version1 (first iteration) the goal is just to add a |
@ThomasLaPiana great! You can find the code that runs tests here: https://github.com/fishtown-analytics/dbt/blob/dev/guion-bluford/dbt/node_runners.py#L423 I think you'll want to override the It's not super clear to me how best to pass the Once you have access to a Manifest object, you can build a table of models and their associated tests. The Manifest is an object that contains all the information we have about a project. I think you'll want to pluck out the test nodes from There's sort of a lot here, but I wanted to point you in the right direction! Let me know if you have any questions, and feel free to open a PR if you want to discuss some code inline :) Thanks for taking this! |
PR is here @drewbanin https://github.com/ThomasLaPiana/dbt/pull/1/files |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
OK, this is wishful thinking... You know how lots of test frameworks have the ability to calculate the proportion of the code tested by a test suite?
Coverage.py
, for Python, and so forth? What if dbt had the ability to compute the proportion of models (or columns) that have schema or custom data tests against them?I'm not even entirely sure I know what this would mean, and I certainly don't know how to do it. But I am sure it'd be useful in pushing dbt developers to write more tests...
The text was updated successfully, but these errors were encountered: