Hi <#C02CTC89LAX|>, <@U06G26CM2QK> we've divided o...
# community-support
r
Hi #C02CTC89LAX, @Denis Kokorin we've divided our main DBT project into 2 parts - one is common models which other teams can use as well and one part which is specific to my team. I'm importing the common model definition (that is, the SQL query) using packages. In the bigquery console, all the test cases including common ones get executed. However, elementary report is only displaying the results which are in my team specific model. Could you please let me know what can be done to display all the executed test cases in the report? Thanks
d
First of all, make sure to run
dbt run -s elementary
before executing tests. Actually you should run it whenever project configuration or any model is changed. Elementary 0.15 (or even 0.14) got significant speed up in metadata upload, so we just run
dbt build
in our project. So in short, try
dbt build
without any filters and then build a report. If that doesn't help, please provide more details. How do you run your project? Did you filter models during run? How is the package with common models organized? Is it a set of sources or does it include both sources and models?
r
We're running dbt run --select elementary before executing the tests. I also added dbt build right before dbt test --select models/er --vars '{"project_name": '$PROJECT_ID'}' command but that didn't help either
Our common project only has model SQL file. We have imported this as a package in our team specific DBT project which has all the test cases in YML file
packages: - package: dbt-labs/dbt_external_tables version: 0.8.7 - local : /opt/dbt_common
d
Do you say, that you define tests in parent project for models imported from local DBT Package?
r
The model in common project is also created by us. It's not inbuilt by DBT. I'm not able to follow what you mean by local DBT package
d
- local : /opt/dbt_common
this
r
Oh that is because we're running it in bigquery cluster. All our test cases get executed. It's just not displaying all the results in elementary
d
Ok, you added DBT Package called
dbt_common
into you project. This package contains some SQL models. Where are tests for this
dbt_common
models defined: in
dbt_common
itself, or in parent (root) project?
r
The tests for dbt-common are defined in parent project
d
I see, then first of all I would suggest either moving
dbt_common
models right to the root project, or moving tests for
dbt_common
into
dbt_common
, or even both options. Could you try that to check if tests will appear in the report?
r
Sure, will try. Thanks so much!