-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix project dir argument when running debug (#1733) #1989
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import os | ||
import re | ||
import yaml | ||
|
||
import pytest | ||
|
||
|
@@ -103,3 +104,27 @@ def test_postgres_badproject(self): | |
self.assertIn('ERROR invalid', line) | ||
elif line.strip().startswith('profiles.yml file'): | ||
self.assertNotIn('ERROR invalid', line) | ||
|
||
@use_profile('postgres') | ||
def test_postgres_not_found_project_dir(self): | ||
self.use_default_project() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't need to call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right @beckjake . I did not realize that it is called in |
||
self.run_dbt(['debug', '--project-dir', 'nopass']) | ||
splitout = self.capsys.readouterr().out.split('\n') | ||
for line in splitout: | ||
if line.strip().startswith('dbt_project.yml file'): | ||
self.assertIn('ERROR not found', line) | ||
|
||
@use_profile('postgres') | ||
def test_postgres_invalid_project_outside_current_dir(self): | ||
# create a dbt_project.yml | ||
project_config = { | ||
'invalid-key': 'not a valid key in this project' | ||
} | ||
os.makedirs('custom', exist_ok=True) | ||
with open("custom/dbt_project.yml", 'w') as f: | ||
yaml.safe_dump(project_config, f, default_flow_style=True) | ||
self.run_dbt(['debug', '--project-dir', 'custom']) | ||
splitout = self.capsys.readouterr().out.split('\n') | ||
for line in splitout: | ||
if line.strip().startswith('dbt_project.yml file'): | ||
self.assertIn('ERROR invalid', line) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add a newline at the end of this file? looking at stuff in the terminal can get annoying without trailing newlines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this line is too long per our styleguide:
via: https://circleci.com/gh/fishtown-analytics/dbt/19769?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
Can you split this onto two lines?