-
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.
Draft Integration test for ref_override
- Loading branch information
1 parent
43f099b
commit 3f763e3
Showing
5 changed files
with
39 additions
and
0 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,4 @@ | ||
a,b | ||
1,2 | ||
2,4 | ||
3,6 |
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,4 @@ | ||
a,b | ||
6,2 | ||
12,4 | ||
18,6 |
2 changes: 2 additions & 0 deletions
2
test/integration/055_ref_override_test/macros/ref_override_macro.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,2 @@ | ||
-- Macro to override ref and always return the same result | ||
{% macro ref(modelname) %} seed_2 {% endmacro %} |
3 changes: 3 additions & 0 deletions
3
test/integration/055_ref_override_test/models/ref_override.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,3 @@ | ||
select | ||
* | ||
from {{ ref('seed_1') }} |
26 changes: 26 additions & 0 deletions
26
test/integration/055_ref_override_test/test_ref_override.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,26 @@ | ||
from test.integration.base import DBTIntegrationTest, use_profile | ||
|
||
|
||
class TestRefOverride(DBTIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "dbt_ref_override_055" | ||
|
||
@property | ||
def project_config(self): | ||
return { | ||
'data-paths': ['data'], | ||
"macro-paths": ["macros"], | ||
} | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
@use_profile('postgres') | ||
def test_postgres_ref_override(self): | ||
self.run_dbt(['seed']) | ||
self.run_dbt(['run']) | ||
# We want it to equal seed_2 and not seed_1. If it's | ||
# still pointing at seed_1 then the override hasn't worked. | ||
self.assertTablesEqual('ref_override', 'seed_2') |