-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Persist timing info for failed nodes (#7353)
- Loading branch information
Showing
4 changed files
with
48 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Fixes | ||
body: Persist timing info in run results for failed nodes | ||
time: 2023-04-13T13:31:57.938847-05:00 | ||
custom: | ||
Author: stu-k | ||
Issue: "5476" |
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,32 @@ | ||
import pytest | ||
from dbt.tests.util import run_dbt | ||
|
||
good_model_sql = """ | ||
select 1 as id | ||
""" | ||
|
||
bad_model_sql = """ | ||
something bad | ||
""" | ||
|
||
|
||
class TestRunResultsTimingSuccess: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"model.sql": good_model_sql} | ||
|
||
def test_timing_exists(self, project): | ||
results = run_dbt(["run"]) | ||
assert len(results.results) == 1 | ||
assert len(results.results[0].timing) > 0 | ||
|
||
|
||
class TestRunResultsTimingFailure: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"model.sql": bad_model_sql} | ||
|
||
def test_timing_exists(self, project): | ||
results = run_dbt(["run"], expect_pass=False) | ||
assert len(results.results) == 1 | ||
assert len(results.results[0].timing) > 0 |