-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] CLI Parameter for
packages-install-path
- Loading branch information
1 parent
a4081e1
commit 33bd419
Showing
5 changed files
with
72 additions
and
1 deletion.
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
46 changes: 46 additions & 0 deletions
46
tests/functional/custom_packages_install_path/test_custom_packages_install_path.py
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,46 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from dbt.tests.util import run_dbt | ||
|
||
|
||
class TestPackagesInstallPathConfig: | ||
@pytest.fixture(scope="class") | ||
def packages(self): | ||
return { | ||
"packages": [ | ||
{ | ||
"package": "fivetran/fivetran_utils", | ||
"version": "0.4.7", | ||
}, | ||
] | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return {"config-version": 2, "packages-install-path": "project_dbt_packages"} | ||
|
||
def test_packages_install_path(self, project): | ||
run_dbt(["deps"]) | ||
assert Path("project_dbt_packages").is_dir() | ||
assert not Path("dbt_packages").is_dir() | ||
|
||
|
||
class TestPackagesInstallPathEnvVar: | ||
def test_packages_install_path(self, project, monkeypatch): | ||
monkeypatch.setenv("DBT_PACKAGES_INSTALL_PATH", "env_dbt_packages") | ||
run_dbt(["deps"]) | ||
assert Path("env_dbt_packages").is_dir() | ||
assert not Path("project_dbt_packages").is_dir() | ||
assert not Path("dbt_packages").is_dir() | ||
|
||
|
||
class TestPackagesInstallPathCliArg: | ||
def test_packages_install_path(self, project, monkeypatch): | ||
monkeypatch.setenv("DBT_PACKAGES_INSTALL_PATH", "env_dbt_packages") | ||
run_dbt(["deps", "--packages-install-path", "cli_dbt_packages"]) | ||
assert Path("cli_dbt_packages").is_dir() | ||
assert not Path("env_dbt_packages").is_dir() | ||
assert not Path("project_dbt_packages").is_dir() | ||
assert not Path("dbt_packages").is_dir() |