Skip to content

Commit

Permalink
Functional test when an exposure references a deprecated model
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 committed Oct 24, 2024
1 parent 67d8f0a commit e32ea5c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/functional/deprecations/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@
email: [email protected]
"""


deprecated_model_exposure_yaml = """
version: 2
models:
- name: model
deprecation_date: 1999-01-01 00:00:00.00+00:00
exposures:
- name: simple_exposure
type: dashboard
depends_on:
- ref('model')
owner:
email: [email protected]
"""

# deprecated test config fixtures
data_tests_yaml = """
models:
Expand Down
13 changes: 13 additions & 0 deletions tests/functional/deprecations/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dbt_common.exceptions import EventCompilationError
from tests.functional.deprecations.fixtures import (
bad_name_yaml,
deprecated_model_exposure_yaml,
models_trivial__model_sql,
)

Expand Down Expand Up @@ -99,6 +100,18 @@ def test_package_redirect_fail(self, project):
assert expected_msg in exc_str


class TestDeprecatedModelExposure:
@pytest.fixture(scope="class")
def models(self):
return {
"model.sql": models_trivial__model_sql,
"exposure.yml": deprecated_model_exposure_yaml,
}

def test_exposure_with_deprecated_model(self, project):
run_dbt(["parse"])


class TestExposureNameDeprecation:
@pytest.fixture(scope="class")
def models(self):
Expand Down

0 comments on commit e32ea5c

Please sign in to comment.