-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature support multiple test cases #54
Feature support multiple test cases #54
Conversation
Forgot to tag you here for visibility: |
279ab09
to
bbe6765
Compare
{# Note: possible to hardcode desired database.schema to store the mocked model output #} | ||
{% set mock_model_relation = api.Relation.create( | ||
database=model.database, | ||
schema=model.schema, | ||
identifier=identifier_name, | ||
type='view') %} |
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 model.database/schema
will retrieve the value from the model where the test is being applied.
Alternatively, I wanted to use the default value as defined in the dbt_project.yaml
, for the seeds. Any idea how to do this?
In my use case, I was able to hard-code the value, but would be nice to have a more elegant solution
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.
Hey @marcellovictorino. Thanks again for submitting this. Great work, and it will be an awesome feature to add.
I left a few comments in the code. Curious to get your thoughts.
Also, I'm finding it a little hard to review both the "multiple test case" feature and the "save output for inspection" feature all at once. Could you split them into 2 separate PRs?
Thanks for the review @mjirv . I really appreciate it :) |
Closing this in favor of splitting the different features into separate PRs: #56 |
This is a:
Description & motivation
Addressing this issue, enables to define a test once, to be applied over multiple test cases.
Applicable when there are multiple test case scenarios, where the mocked input and expected output data (seed) represent a single case, having the seed file names identified by
test_case_1
,test_case_2
etc.Checklist
Additional comments
I am not sure what is the best way to adapt the proposed code change to the new dispatch pattern. I developed these changes against an old package version (
v 0.1.2
). I marked it with the comment{% FIXME: ...
Also, I have changed the
get_test
macro behavior to always store the mocked model output as a view, which provides better visibility on failing tests. As aview
, it is possible to inspect its definition, quickly debugging any issues