How to defer upstream references

The problem I’m having

I saw in the dbt docs that “In v0.19.0, dbt added support for deferring upstream references when testing. If a test selects from a model that doesn’t exist as a database object in your current environment, dbt will look to the other environment instead—the one defined in your state manifest.” - Caveats to state comparison | dbt Developer Hub

However, I don’t see where in the docs that functionality is actually explained in terms of how I can use it.

When I run dbt core locally, I don’t want to have to build every upstream dependency of a changed model in my personal snowflake DB clone, and just want to use the existing models that exist in our main snowflake DB. How do I do that?

Hi @htz , I think this is what you are looking for

You have to save the artifacts of your main DB in a folder and pass the folder’s path to the --state flag

dbt test --select model_b --defer --state prod-run-artifacts