Hi there
I have two models and I need to test whether all lines from one model were rolled up to a second model.
Testing is very easy as I only need to create a singular test and write a LEFT OUTER JOIN between these 2 models, but when I run “dbt test --select s4_venda_mensal”, dbt run the singular test which fails because lines from “s4_venda_mensal” (model one) were not moved to “s4_ocupacao” (model two).
In my case, the singular test is only relevant to test “s4_ocupacao” (model two), but dbt understands that all models referred in singular test should be tested when “dbt test” is invoked for individual model.
Question: how to skip testing a given singular test from a given model?
That’s my singular test script:
SELECT
vnd.nr_competencia,
vnd.pk_contrato,
vnd.vl_venda
FROM {{ ref('s4_venda_mensal') }} AS vnd
LEFT OUTER JOIN {{ ref('s4_ocupacao') }} AS ocu
ON ocu.nr_competencia = vnd.nr_competencia
AND ocu.pk_contrato = vnd.pk_contrato
WHERE vnd.nr_competencia IN (SELECT nr_competencia FROM var_periodo)
AND ocu.pk_contrato IS NULL
As said, this script is only relevant to test model name s4_ocupacao. When I run “dbt test --select sr_venda_mensal” it would be nice if the singular test would be skipped.
Any thoughts ?