Skip to content

Commit 677b181

Browse files
committed
test fixes
1 parent 7ae883b commit 677b181

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ def _with_microbatch_test_models(dbt_project: DbtProject, test_id: str):
6060

6161
source_model_path.write_text(_microbatch_source_model_sql())
6262
target_model_path.write_text(_microbatch_model_sql(source_model_name))
63+
relative_source_model_path = source_model_path.relative_to(dbt_project.project_dir_path)
6364
relative_target_model_path = target_model_path.relative_to(dbt_project.project_dir_path)
6465
try:
65-
yield relative_target_model_path
66+
yield relative_source_model_path, relative_target_model_path
6667
finally:
6768
if source_model_path.exists():
6869
source_model_path.unlink()
@@ -73,8 +74,13 @@ def _with_microbatch_test_models(dbt_project: DbtProject, test_id: str):
7374
def _run_microbatch_model_and_get_latest_success_result(
7475
dbt_project: DbtProject, test_id: str
7576
):
76-
with _with_microbatch_test_models(dbt_project, test_id) as model_path:
77-
dbt_project.dbt_runner.run(select=str(model_path))
77+
with _with_microbatch_test_models(dbt_project, test_id) as (
78+
source_model_path,
79+
model_path,
80+
):
81+
dbt_project.dbt_runner.run(
82+
select=f"{source_model_path} {model_path}"
83+
)
7884

7985
unique_id = f"model.elementary_tests.{test_id}"
8086
run_results = dbt_project.read_table(

0 commit comments

Comments
 (0)