-
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.
* Enable record/replay via environment variables. * Add support for recording dbt's interactions, enabled by env var. * Add changelog entry.
- Loading branch information
1 parent
bcbde3a
commit f6b2cb7
Showing
3 changed files
with
60 additions
and
3 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: Under the Hood | ||
body: Enable use of record mode via environment variable | ||
time: 2024-04-25T17:01:38.093524-04:00 | ||
custom: | ||
Author: peterallenwebb | ||
Issue: "10045" |
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,17 @@ | ||
import os | ||
|
||
from dbt.tests.util import run_dbt | ||
|
||
|
||
class TestRecord: | ||
def test_record_when_env_var_set(self, project): | ||
temp = os.environ.get("DBT_RECORD", None) | ||
try: | ||
os.environ["DBT_RECORD"] = "True" | ||
run_dbt(["run"]) | ||
assert os.path.isfile(os.path.join(os.getcwd(), "recording.json")) | ||
finally: | ||
if temp is None: | ||
del os.environ["DBT_RECORD"] | ||
else: | ||
os.environ["DBT_RECORD"] = temp |