From 135ef8f44bdd1e89f5fb51686c996ba5e18a40ad Mon Sep 17 00:00:00 2001 From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:42:09 -0700 Subject: [PATCH 1/2] Add caveat about including all necessary given input fixtures for unit tests --- website/docs/docs/build/unit-tests.md | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/docs/build/unit-tests.md b/website/docs/docs/build/unit-tests.md index 040680c3126..df1dd3e4a75 100644 --- a/website/docs/docs/build/unit-tests.md +++ b/website/docs/docs/build/unit-tests.md @@ -28,6 +28,7 @@ Starting in dbt Core v1.8, we have introduced an additional type of test to dbt - If your model has multiple versions, by default the unit test will run on *all* versions of your model. Read [unit testing versioned models](/reference/resource-properties/unit-testing-versions) for more information. - Unit tests must be defined in a YML file in your `models/` directory. - Table names must be [aliased](/docs/build/custom-aliases) in order to unit test `join` logic. +- All [`ref`](/reference/dbt-jinja-functions/ref) or [`source`](/reference/dbt-jinja-functions/source) references within the model must be included in the unit test configuration as`input`s otherwise you may encounter "node not found" errors during compilation. - Redshift customers need to be aware of a [limitation when building unit tests](/reference/resource-configs/redshift-configs#unit-test-limitations) that requires a workaround. Read the [reference doc](/reference/resource-properties/unit-tests) for more details about formatting your unit tests. From 82dd82bc443a853ff142595957a57b3f14c907ee Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:59:18 +0000 Subject: [PATCH 2/2] Update website/docs/docs/build/unit-tests.md --- website/docs/docs/build/unit-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/docs/build/unit-tests.md b/website/docs/docs/build/unit-tests.md index df1dd3e4a75..53382486a22 100644 --- a/website/docs/docs/build/unit-tests.md +++ b/website/docs/docs/build/unit-tests.md @@ -28,7 +28,7 @@ Starting in dbt Core v1.8, we have introduced an additional type of test to dbt - If your model has multiple versions, by default the unit test will run on *all* versions of your model. Read [unit testing versioned models](/reference/resource-properties/unit-testing-versions) for more information. - Unit tests must be defined in a YML file in your `models/` directory. - Table names must be [aliased](/docs/build/custom-aliases) in order to unit test `join` logic. -- All [`ref`](/reference/dbt-jinja-functions/ref) or [`source`](/reference/dbt-jinja-functions/source) references within the model must be included in the unit test configuration as`input`s otherwise you may encounter "node not found" errors during compilation. +- Include all [`ref`](/reference/dbt-jinja-functions/ref) or [`source`](/reference/dbt-jinja-functions/source) model references in the unit test configuration as `input`s to avoid "node not found" errors during compilation. - Redshift customers need to be aware of a [limitation when building unit tests](/reference/resource-configs/redshift-configs#unit-test-limitations) that requires a workaround. Read the [reference doc](/reference/resource-properties/unit-tests) for more details about formatting your unit tests.