define tests in dbt_project.yml

PHOTO EMBED

Mon May 08 2023 05:12:28 GMT+0000 (Coordinated Universal Time)

Saved by @klleee28 #dbt #test #global

models:
  advanced_testing:
    # checks for every model under models directory should have unique and not_null test
    +required_tests: {"unique.*|not_null": 2}
    # checks for 'exclude' directory models should have unique and not_null test
    exclude:
      +required_tests: {"unique.*|not_null": 2}
	# checks for 'marts' directory models should have relationship test
    marts:
      +required_tests: {'relationship.*': 1}
content_copyCOPY

Checks globally or in each directory to ensure specified tests have been assigned.