-
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
pytest conversion test_selection, schema_tests, fail_fast, permission #4826
Conversation
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.
core/dbt/tests/fixtures/project.py
Outdated
@@ -118,16 +128,22 @@ def project_config_update(): | |||
return {} | |||
|
|||
|
|||
@pytest.fixture | |||
def model_path(): |
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 part is needed in some tests that have more complex file structure
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.
The model dictionaries can be nested. i.e.:
{ "my_model.sql": '....', "subdir": { "another_model.sql": "..."}}
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.
Yea, but this is used to specify model files to use for a run. previous integration tests supported it here
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.
Which tests in the old integration tests? I know that the old integration test framework did that, but it was because they had directories for multiple projects in the same test directory, and we don't need that anymore.
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 one . Basically every test class has it's own models
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.
I can refactor it to just one models artifact per class if we want to do that.
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.
Yes, but we don't need that anymore. We just construct a models fixture with the right files. They did that because every test had to have a separate directory, otherwise tests would interfere with each other.
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.
I think one models fixture per class is probably better.
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.
@gshank this is resolved, anything else we would like to change about this PR?
87e31c1
to
5615691
Compare
check_audit_table(project) | ||
|
||
|
||
class TestFailFastFromConfig(TestFastFailingDuringRun): |
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.
The original test did this but I am not too sure why
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.
If you look at the project config, there's an "on-run-start" config that creates the audit table at the beginning of a run, and a pre-hook that inserts into the table for every model in the project that's run. So it's looking to see how many models were run.
I think it's fine to combine multiple tests into one PR. |
case_sensitive_models__schema_yaml = """ | ||
|
||
""" |
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.
Is this test testing for a yml and yaml file or is this just trash from the original test we can delete? Based on the name it seems like trash.
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.
Did a search and looks like there's nothing using it so I removed it as suggested
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. |
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.
Just the one change and it will be good to go.
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. |
You need to add the |
0169e63
to
9d2d474
Compare
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.
Looks good now, once you have the Changelog thing handled.
resolves #
Some test in this is fully by convert_test, by running
then do a little bit clean up of unused import.
Some require a bit of manual work to clean up the functions, i.e. we didn't have dbt tests so people were implementing it in tests.
Description
Checklist
CHANGELOG.md
and added information about my change