How can I make sure that specific tests are run be...
# ask-community
j
How can I make sure that specific tests are run before and after dbt asset materialization? Ideally, when materializing a single dbt asset that I loaded with
load_assets_from_dbt_project
I would want all tests to run that are defined on the asset's sources and after materialization I would want all tests to be run that are defined on that specific table. It would be cool to have a
add_asset_tests
and
add_source_tests
parameter or a workaround to make sure that the appropriate tests are run. I'm not sure how to go about this. Should I try adding a generic upstream and downstream asset that runs the test?
r
Check out https://github.com/dagster-io/dagster/discussions/14477. These new APIs will allow for this behavior.
j
Oh, awesome! This looks exactly like what I need.
❤️ 1
Thanks for the help and the great documentation :)
r
Let me know if you encounter any problems! Feel free to chime in the discussion — we want to make sure everyone’s use cases are accounted for in these new APIs we’re providing 🫡
🎉 2