Skip to content

Commit

Permalink
Add run step to function test of unit test with external nodes
Browse files Browse the repository at this point in the history
This is necessary because when executing a unit tests, the columns
associated with a model in the database are retrieved. For this to
be possible, the model must exist in the database, thus we must
run the associated models at least once first.
  • Loading branch information
QMalcolm committed Jan 18, 2024
1 parent 3584e6e commit b57a7f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/functional/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,5 +326,7 @@ def test_unit_test_ext_nodes(

# `seed` need so a table exists for `external_model` to point to
run_dbt(["seed"], expect_pass=True)
# `run` needed to ensure `top_level_domains` exists in database for column getting step
run_dbt(["run"], expect_pass=True)
results = run_dbt(["test", "--select", "valid_emails"], expect_pass=True)
assert len(results) == 1

0 comments on commit b57a7f7

Please sign in to comment.