-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for configuring community/nightly extensions in the profi…
…le directly
- Loading branch information
Showing
4 changed files
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import pytest | ||
from dbt.tests.util import ( | ||
check_relation_types, | ||
check_relations_equal, | ||
check_result_nodes_by_name, | ||
relation_from_name, | ||
run_dbt, | ||
) | ||
|
||
class BaseCommunityExtensions: | ||
|
||
@pytest.fixture(scope="class") | ||
def dbt_profile_target(self, dbt_profile_target): | ||
dbt_profile_target["extensions"] = [ | ||
{"name": "quack", "repo": "community"}, | ||
] | ||
return dbt_profile_target | ||
|
||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"quack_model.sql": "select quack('world') as quack_world", | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return { | ||
"name": "base", | ||
} | ||
|
||
def test_base(self, project): | ||
|
||
# run command | ||
results = run_dbt() | ||
# run result length | ||
assert len(results) == 1 | ||
|
||
# names exist in result nodes | ||
check_result_nodes_by_name( | ||
results, | ||
[ | ||
"quack_model", | ||
], | ||
) | ||
|
||
# check relation types | ||
expected = { | ||
"quack_model": "view", | ||
} | ||
check_relation_types(project.adapter, expected) | ||
|
||
@pytest.mark.skip_profile("buenavista") | ||
class TestCommunityExtensions(BaseCommunityExtensions): | ||
pass |