-
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.
Merge pull request #1878 from fishtown-analytics/feature/run-operatio…
…n-snapshot-rpc add run-operation + snapshot to the RPC server (#1875)
- Loading branch information
Showing
10 changed files
with
442 additions
and
116 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
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
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,54 @@ | ||
import os | ||
import pytest | ||
import random | ||
import time | ||
from typing import Dict, Any | ||
|
||
import yaml | ||
|
||
|
||
@pytest.fixture | ||
def unique_schema() -> str: | ||
return "test{}{:04}".format(int(time.time()), random.randint(0, 9999)) | ||
|
||
|
||
@pytest.fixture | ||
def profiles_root(tmpdir): | ||
return tmpdir.mkdir('profile') | ||
|
||
|
||
@pytest.fixture | ||
def project_root(tmpdir): | ||
return tmpdir.mkdir('project') | ||
|
||
|
||
@pytest.fixture | ||
def postgres_profile_data(unique_schema): | ||
return { | ||
'config': { | ||
'send_anonymous_usage_stats': False | ||
}, | ||
'test': { | ||
'outputs': { | ||
'default': { | ||
'type': 'postgres', | ||
'threads': 4, | ||
'host': 'database', | ||
'port': 5432, | ||
'user': 'root', | ||
'pass': 'password', | ||
'dbname': 'dbt', | ||
'schema': unique_schema, | ||
}, | ||
}, | ||
'target': 'default' | ||
} | ||
} | ||
|
||
|
||
@pytest.fixture | ||
def postgres_profile(profiles_root, postgres_profile_data) -> Dict[str, Any]: | ||
path = os.path.join(profiles_root, 'profiles.yml') | ||
with open(path, 'w') as fp: | ||
fp.write(yaml.safe_dump(postgres_profile_data)) | ||
return postgres_profile_data |
Oops, something went wrong.