[Bug] dbt build with --empty
flag compiles unit tests with empty mock fixtures
#10516
Closed
2 tasks done
Labels
bug
Something isn't working
empty
Issues related to the --empty CLI flag
High Severity
bug with significant impact that should be resolved in a reasonable timeframe
unit tests
Issues related to built-in dbt unit testing functionality
Is this a new bug in dbt-core?
Current Behavior
When you perform
dbt build -s <some_model> --empty
, and there are unit tests associated with<some_model>
, the fixtures for the mocks in the unit test will return 0 records, but the expectations continue to use the full fixture. This always leads to a failure of the unit test.The compiled code for the fixture looks like this:
Expected Behavior
Unit tests should ignore the
--empty
flag. Fixtures for both mocks and expectations should be respected regardless of tags.Steps To Reproduce
ref()
orsource()
)dbt build -s <some_model> --empty
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: