-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enable using the list command on unit tests #9480
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9480 +/- ##
==========================================
+ Coverage 87.90% 87.97% +0.06%
==========================================
Files 164 167 +3
Lines 22076 22160 +84
==========================================
+ Hits 19407 19496 +89
+ Misses 2669 2664 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
core/dbt/task/list.py
Outdated
@@ -113,6 +113,8 @@ def generate_selectors(self): | |||
elif node.resource_type == NodeType.Unit: | |||
assert isinstance(node, UnitTestDefinition) | |||
unit_test_selector = ".".join([node.package_name, node.name]) | |||
if node.version: |
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.
This should be a direct comparison to None
to ensure version=0
is handled correctly.
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.
It might be worth implementing a property on UnitTestDefinition.. maybe versioned_name
? and consolidate this logic here + in formatting in test.py: https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/test.py#L87-L88
your call!
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.
approved pending one outstanding comment re: handling v0
resolves #8508
Problem
Users want to be able to list their unit tests.
Solution
Update the list command to handle listing unit tests
Checklist