-
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.
Merge pull request #2708 from rsenseman/enhancement/color_output_comm…
…and_line_flag_second_attempt Add --use-colors cli option (second attempt)
- Loading branch information
Showing
11 changed files
with
123 additions
and
32 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
1 change: 1 addition & 0 deletions
1
test/integration/061_use_colors_tests/models/do_nothing_then_fail.sql
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 @@ | ||
select 1, |
29 changes: 29 additions & 0 deletions
29
test/integration/061_use_colors_tests/test_no_use_colors.py
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,29 @@ | ||
|
||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import logging | ||
import re | ||
import sys | ||
|
||
class TestNoUseColors(DBTIntegrationTest): | ||
|
||
@property | ||
def project_config(self): | ||
return {'config-version': 2} | ||
|
||
@property | ||
def schema(self): | ||
return "use_colors_tests_061" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@use_profile('postgres') | ||
def test_postgres_no_use_colors(self): | ||
# pattern to match formatted log output | ||
pattern = re.compile(r'\[31m.*|\[33m.*') | ||
|
||
results, stdout = self.run_dbt_and_capture(args=['--no-use-colors', 'run'], expect_pass=False) | ||
|
||
stdout_contains_formatting_characters = bool(pattern.search(stdout)) | ||
self.assertFalse(stdout_contains_formatting_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,29 @@ | ||
|
||
from test.integration.base import DBTIntegrationTest, use_profile | ||
import logging | ||
import re | ||
import sys | ||
|
||
class TestUseColors(DBTIntegrationTest): | ||
|
||
@property | ||
def project_config(self): | ||
return {'config-version': 2} | ||
|
||
@property | ||
def schema(self): | ||
return "use_colors_tests_061" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@use_profile('postgres') | ||
def test_postgres_use_colors(self): | ||
# pattern to match formatted log output | ||
pattern = re.compile(r'\[31m.*|\[33m.*') | ||
|
||
results, stdout = self.run_dbt_and_capture(args=['--use-colors', 'run'], expect_pass=False) | ||
|
||
stdout_contains_formatting_characters = bool(pattern.search(stdout)) | ||
self.assertTrue(stdout_contains_formatting_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