dbt lineage issue with dbt build and tests

I finally found the issue. I will post the answer here in case someone was having similar issue. I was getting error for 3 tests that are generated from one generic test… which are related to models are not part of the lineage. The generic test code was as following:

{% test data_latency(model, column_name, unit, num_units) %}

{{ config(severity = 'warn' if target.database == 'DEV_EDW_DB'
                            and model == ref('int_iterable_events')
                        else 'error') }}

select
    max({{ column_name }}) as max_timestamp
from {{ model }}
having max_timestamp < date_trunc('{{ unit }}', dateadd('{{ unit }}',-{{ num_units }},current_timestamp()))

{% endtest %}

That ref in the beginning of the test was making the mess… and breaking the lineage. when I removed it, it was solved.