-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
180 additions
and
164 deletions.
There are no files selected for viewing
File renamed without changes.
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,9 @@ | ||
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod | ||
|
||
|
||
class TestBaseAdapterMethod(BaseAdapterMethod): | ||
pass | ||
|
||
|
||
class TestBaseCaching(BaseAdapterMethod): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_base import BaseSimpleMaterializations | ||
|
||
|
||
class TestBaseSimpleMaterializations(BaseSimpleMaterializations): | ||
pass |
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,97 @@ | ||
import os | ||
|
||
import pytest | ||
from dbt.tests.util import ( | ||
run_dbt, | ||
) | ||
|
||
# CSV content with boolean column type. | ||
seeds_boolean_csv = """ | ||
key,value | ||
abc,true | ||
def,false | ||
hij,true | ||
klm,false | ||
""".lstrip() | ||
|
||
# CSV content with empty fields. | ||
seeds_empty_csv = """ | ||
key,val1,val2,str1 | ||
abc,1,1,some_str | ||
abc,1,0,"another string" | ||
def,1,0, | ||
hij,1,1,Caps | ||
hij,1,,"second string" | ||
klm,1,0,"test" | ||
klm,1,,"test4" | ||
""".lstrip() | ||
|
||
seeds_schema_yml = """ | ||
version: 2 | ||
seeds: | ||
- name: empty | ||
config: | ||
column_types: | ||
val2: Nullable(UInt32) | ||
str1: Nullable(String) | ||
""" | ||
|
||
replicated_seeds_schema_yml = """ | ||
version: 2 | ||
seeds: | ||
- name: empty | ||
config: | ||
engine: ReplicatedMergeTree('/clickhouse/tables/{uuid}/one_shard', '{server_index}' ) | ||
column_types: | ||
val2: Nullable(UInt32) | ||
str1: Nullable(String) | ||
""" | ||
|
||
base_seeds_schema_yml = """ | ||
version: 2 | ||
seeds: | ||
- name: base | ||
config: | ||
engine: ReplicatedMergeTree('/clickhouse/tables/{uuid}/one_shard', '{server_index}' ) | ||
""" | ||
|
||
|
||
class TestCSVSeed: | ||
@pytest.fixture(scope="class") | ||
def seeds(self): | ||
return { | ||
"schema.yml": seeds_schema_yml, | ||
"boolean.csv": seeds_boolean_csv, | ||
"empty.csv": seeds_empty_csv, | ||
} | ||
|
||
def test_seed(self, project): | ||
# seed command | ||
results = run_dbt(["seed"]) | ||
assert len(results) == 2 | ||
columns = project.run_sql("DESCRIBE TABLE empty", fetch='all') | ||
assert columns[2][1] == 'Nullable(UInt32)' | ||
assert columns[3][1] == 'Nullable(String)' | ||
|
||
|
||
class TestReplicatedCSVSeed: | ||
@pytest.fixture(scope="class") | ||
def seeds(self): | ||
return { | ||
"schema.yml": replicated_seeds_schema_yml, | ||
"empty.csv": seeds_empty_csv, | ||
} | ||
|
||
@pytest.mark.skipif( | ||
os.environ.get('DBT_CH_TEST_CLUSTER', '').strip() == '', reason='Not on a cluster' | ||
) | ||
def test_seed(self, project): | ||
# seed command | ||
results = run_dbt(["seed"]) | ||
assert len(results) == 1 | ||
columns = project.run_sql("DESCRIBE TABLE empty", fetch='all') | ||
assert columns[2][1] == 'Nullable(UInt32)' | ||
assert columns[3][1] == 'Nullable(String)' |
File renamed without changes.
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,5 @@ | ||
from dbt.tests.adapter.basic.test_empty import BaseEmpty | ||
|
||
|
||
class TestEmpty(BaseEmpty): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_ephemeral import BaseEphemeral | ||
|
||
|
||
class TestEphemeral(BaseEphemeral): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_generic_tests import BaseGenericTests | ||
|
||
|
||
class TestGenericTests(BaseGenericTests): | ||
pass |
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,24 @@ | ||
import pytest | ||
from dbt.tests.adapter.basic.test_incremental import BaseIncremental, BaseIncrementalNotSchemaChange | ||
|
||
|
||
class TestIncremental(BaseIncremental): | ||
pass | ||
|
||
|
||
incremental_not_schema_change_sql = """ | ||
{{ config(materialized="incremental", unique_key="user_id_current_time",on_schema_change="sync_all_columns") }} | ||
select | ||
toString(1) || '-' || toString(now64()) as user_id_current_time, | ||
{% if is_incremental() %} | ||
'thisis18characters' as platform | ||
{% else %} | ||
'okthisis20characters' as platform | ||
{% endif %} | ||
""" | ||
|
||
|
||
class TestIncrementalNotSchemaChange(BaseIncrementalNotSchemaChange): | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"incremental_not_schema_change.sql": incremental_not_schema_change_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,5 @@ | ||
from dbt.tests.adapter.basic.test_singular_tests import BaseSingularTests | ||
|
||
|
||
class TestSingularTests(BaseSingularTests): | ||
pass |
5 changes: 0 additions & 5 deletions
5
tests/integration/adapter/test_singular.py → ...er/basic/test_singular_tests_ephemeral.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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
from dbt.tests.adapter.basic.test_singular_tests import BaseSingularTests | ||
from dbt.tests.adapter.basic.test_singular_tests_ephemeral import BaseSingularTestsEphemeral | ||
|
||
|
||
class TestSingularTests(BaseSingularTests): | ||
pass | ||
|
||
|
||
class TestSingularTestsEphemeral(BaseSingularTestsEphemeral): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_snapshot_check_cols import BaseSnapshotCheckCols | ||
|
||
|
||
class TestSnapshotCheckCols(BaseSnapshotCheckCols): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp | ||
|
||
|
||
class TestSnapshotTimestamp(BaseSnapshotTimestamp): | ||
pass |
5 changes: 5 additions & 0 deletions
5
tests/integration/adapter/basic/test_table_materialization.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,5 @@ | ||
from dbt.tests.adapter.basic.test_table_materialization import BaseTableMaterialization | ||
|
||
|
||
class TestTableMat(BaseTableMaterialization): | ||
pass |
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,5 @@ | ||
from dbt.tests.adapter.basic.test_validate_connection import BaseValidateConnection | ||
|
||
|
||
class TestValidateConnection(BaseValidateConnection): | ||
pass |
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