In the OSS, is there a way to generate dbt test fo...
# ask-elementary-ai
a
In the OSS, is there a way to generate dbt test for sources only and to show downstream models of sources that have a failed test ?
k
A message from kapa.ai
Based on the available knowledge sources: 1. Generating dbt tests for sources only: Yes, you can generate and run dbt tests specifically for sources in Elementary OSS. Tests such as freshness anomalies, volume anomalies, and schema changes from baseline can be defined directly on sources in your YAML files. These tests are executed when you run
dbt test
, and you can target only sources using selectors like
dbt test --select source:<source_name>
or by specifying tags. You do not need to run models or materialize anything in the database to test sources—defining tests in the source schema files is sufficient, and sources can have tests even if they are not referenced by any models in your dbt project. This approach allows you to test sources independently from models, as confirmed by Elementary support and community members [source](https://slack.com/archives/C02CTC89LAX/p1695978468617869). 2. Showing downstream models of sources that have a failed test: The knowledge sources do not indicate that Elementary OSS natively provides a feature to automatically show or skip downstream models of sources with failed tests in the UI or reports. While dbt’s
dbt build
command can prevent downstream models from being built if a test on a model fails, this behavior does not extend to source tests, as sources are not part of the dbt DAG in the same way as models. There is no mention of a built-in Elementary OSS feature that visualizes or enforces downstream model dependencies based on source test failures. Some users have discussed workarounds, but there is no official support for this in OSS at this time [source](https://slack.com/archives/C02CTC89LAX/p1698942973876529). Summary: - You can generate and run dbt tests for sources only. - There is no built-in way in Elementary OSS to show or act on downstream models of sources with failed tests. If you need more advanced dependency handling or visualization, you may need to implement custom logic or explore other tools, as this is not currently supported out-of-the-box in Elementary OSS.