Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for disabled/non-existent models fail silently #968

Closed
drewbanin opened this issue Aug 30, 2018 · 4 comments
Closed

Tests for disabled/non-existent models fail silently #968

drewbanin opened this issue Aug 30, 2018 · 4 comments
Assignees
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Milestone

Comments

@drewbanin
Copy link
Contributor

drewbanin commented Aug 30, 2018

Issue

Issue description

When running dbt test, tests which reference non-existent or disabled models will not run, and there is no associated info or debug message indicating why.

We made dbt skip these tests quietly on purpose here. This is to avoid error messages if you disable a model but still have tests for that model. This happens somewhat frequently with models inside of dbt packages.

Results

A custom data test which refs a nonexistent or disabled model does not run, and no warning or error is emitted.

System information

this bug is present in dbt at the time of the 0.11.0 release

Steps to reproduce

-- tests/some_test.sql

select * from {{ ref('this_model_does_not_exist') }}
$ dbt test
@drewbanin drewbanin added the bug Something isn't working label Aug 30, 2018
@elexisvenator
Copy link
Contributor

Most test suites has the concept of a skipped/inconclusive test, with an option to treat skipped as errors. I think it would make sense to do the same thing here.

@drewbanin
Copy link
Contributor Author

Good idea @elexisvenator.

Another place this can happen is in relationship tests with non-existent refs used in foreign keys

@drewbanin drewbanin added the good_first_issue Straightforward + self-contained changes, good for new contributors! label Nov 30, 2018
@drewbanin
Copy link
Contributor Author

Update: schema tests for invalid models also fail silently. We should just add a warning:

WARNING: Tests exist for the model `{model name}` which was not found (or disabled)

@drewbanin drewbanin added this to the Grace Kelly milestone Dec 3, 2018
@beckjake beckjake self-assigned this Dec 4, 2018
beckjake added a commit that referenced this issue Dec 5, 2018
…-on-missing-test-refs

log warnings on missing test refs [#968]
@Cskyleryoung
Copy link

Is there a way to make these fail silently again? A manual flag or other config? We are running tons of DBT packages in Dagster, which is polling for tests actively like every 30 seconds while running, and it's clogging our logs up with DBT warnings. We have a large number of global tests where we explicitly don't expect all models to be present at all times. We're just verifying columns and a few other tests for tables that do exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

No branches or pull requests

4 participants