singular test - question about ref and source .

hi ,
i developed a singular test as mentioned below :

{{ config(error_if = ‘>0’,severity = ‘error’) }}

select count() cnt
from {{ ref(‘stg_dim_xxx’) }} a join {{source(‘main’,‘dim_date’)}} dd
on dd.date_key between a.start_date and a._end_date
where dd.date_key between current_date - 8 and current_date - 1
group by a.gw_mid_id, a.target_mid_id, dd.date_key
having count(
) > 1

if the test failed so dbt keep running and run all the models .

after few checks I saw that the problem is with the left join to source dim date .

what is the best practice? do singular test must be only with refs and not sources ?