Skip to content

Commit

Permalink
Fix #8948: Add target-path to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Feb 23, 2024
1 parent c583c7d commit 55d8b67
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240223-162107.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Add target-path to retry
time: 2024-02-23T16:21:07.83639Z
custom:
Author: aranke
Issue: "8948"
21 changes: 18 additions & 3 deletions tests/functional/retry/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,20 +330,35 @@ def test_retry(self, project):
assert len(results) == 1


class TestRetryEnvVar:
class TestRetryTargetPathEnvVar:
@pytest.fixture(scope="class")
def models(self):
return {
"sample_model.sql": models__sample_model,
}

def test_retry_env_var(self, project, monkeypatch):
def test_retry_target_path_env_var(self, project, monkeypatch):
monkeypatch.setenv("DBT_TARGET_PATH", "artifacts")
run_dbt(["run"], expect_pass=False)

write_file(models__second_model, "models", "sample_model.sql")

results = run_dbt(["retry"])
assert len(results) == 1


class TestRetryTargetPathFlag:
@pytest.fixture(scope="class")
def models(self):
return {
"sample_model.sql": models__sample_model,
}

def test_retry_target_path_env_var(self, project, monkeypatch):
run_dbt(["run"], expect_pass=False)

write_file(models__second_model, "models", "sample_model.sql")

results = run_dbt(["retry", "--target-path", "artifacts"])
assert len(results) == 1
assert Path("artifacts").is_dir()
assert not Path("target").is_dir()

0 comments on commit 55d8b67

Please sign in to comment.