-
Notifications
You must be signed in to change notification settings - Fork 119
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
Port testing framework changes. #70
Conversation
@ueshin You beat me to it! I was planning to open an issue for the testing framework migration in the Draft docs (dbt-labs/docs.getdbt.com#1263) for using the new framework: https://deploy-preview-1263--docs-getdbt-com.netlify.app/docs/contributing/testing-a-new-adapter We've also got work in progress (dbt-labs/dbt-core#4958) to convert and consolidate the test case that you ported in #62, so that you can inherit + run these test cases with a lot less copy-pasted code. |
@jtcohen6 Yes, we are keeping an eye on
That's really good to know! Looking forward to it being merged. |
@@ -29,7 +29,7 @@ deps = | |||
|
|||
[testenv:integration-databricks-cluster] | |||
basepython = python3 | |||
commands = /bin/bash -c '{envpython} -m pytest -v tests/specs/databricks-cluster.dbtspec {posargs}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' | |||
commands = /bin/bash -c '{envpython} -m pytest -v --profile databricks_cluster tests/functional/adapter/test_basic.py {posargs}; ret=$?; [ $ret = 5 ] && exit 0 || exit $ret' |
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 like the --profile
option! I am curious if we can change the integration tests to use this too.
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 we can, in a separate PR, and/or we can contribute to dbt-spark
if they want.
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.
Or dbt-labs/dbt-core#4958 will provide the testing framework even for custom integration tests?
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.
@ueshin Correct, our thinking is that this framework will provide the foundation for:
- basic test cases (minimum expectations for any dbt adapter)
- optional additional test cases for more advanced functionality (we'll be gradually adding, e.g. init push up of converted unique_key tests dbt-labs/dbt-core#4958)
- your own custom integration/functional tests, which can tap into the same reusable utilities
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.
As far as the --profile
option in particular: It looks like this is something we added in dbt-spark
(https://github.com/dbt-labs/dbt-spark/blob/main/tests/conftest.py), rather than the test utilities built into dbt-core
(since the tests there only use a single Postgres profile). @gshank Do you see merit in standardizing this for all plugin maintainers, by moving pytest_addoption
and dbt_profile_target
into dbt-core
? Or must they be defined in each plugin's own conftest.py
?
Thanks! merging. |
Description
Port testing framework changes from dbt-labs/dbt-spark#299 and dbt-labs/dbt-spark#314.