-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix for custom generic tests #211
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ def models(self) -> Dict[str, ModelNode]: | |
return self._models | ||
|
||
self._models = { | ||
node_name: node | ||
node_name: node # type: ignore | ||
for node_name, node in self.manifest.nodes.items() | ||
if node.resource_type == "model" and isinstance(node, ModelNode) | ||
} | ||
|
@@ -328,11 +328,16 @@ def find_jinja_blocks(self) -> Dict[str, JinjaBlock]: | |
) | ||
|
||
for unique_id, macro in self.manifest.macros.items(): | ||
block_type = "macro" | ||
name = macro.name | ||
if macro.package_name != self.name: | ||
continue | ||
if "tests/generic/" in macro.path: | ||
block_type = "test" | ||
name = macro.name[5:] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't feel super confident in using this hard-coded path. Would it make sense to use the test directory provided in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that makes sense to me! will update |
||
|
||
blocks[unique_id] = JinjaBlock.from_file( | ||
path=self.path / macro.original_file_path, block_type="macro", name=macro.name | ||
path=self.path / macro.original_file_path, block_type=block_type, name=name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really like that this function has been parameterized 👍🏻 🪨 |
||
) | ||
|
||
return blocks | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% test custom_generic_test(model) %} | ||
select true where false | ||
{% endtest %} |
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.
👍🏻