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. |
| [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.
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.
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.
Or dbt-labs/dbt-core#4958 will provide the testing framework even for custom integration tests?
There was a problem hiding this comment.
@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.
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.