Skip to content

Commit 348fa1b

Browse files
committed
add tests added in dbt 1.3.x
1 parent 4235e3d commit 348fa1b

File tree

5 files changed

+79
-1
lines changed

5 files changed

+79
-1
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from dbt.tests.util import (
2+
run_dbt,
3+
check_relations_equal,
4+
rm_file,
5+
write_file
6+
)
7+
from dbt.tests.adapter.concurrency.test_concurrency import (
8+
BaseConcurrency,
9+
seeds__update_csv
10+
)
11+
12+
13+
class TestConncurenncySqlite(BaseConcurrency):
14+
15+
def test_conncurrency_sqlite(self, project):
16+
run_dbt(["seed", "--select", "seed"])
17+
results = run_dbt(["run"], expect_pass=False)
18+
assert len(results) == 7
19+
check_relations_equal(project.adapter, ["SEED", "VIEW_MODEL"])
20+
check_relations_equal(project.adapter, ["SEED", "DEP"])
21+
check_relations_equal(project.adapter, ["SEED", "TABLE_A"])
22+
check_relations_equal(project.adapter, ["SEED", "TABLE_B"])
23+
24+
rm_file(project.project_root, "seeds", "seed.csv")
25+
write_file(seeds__update_csv, project.project_root + '/seeds', "seed.csv")
26+
results = run_dbt(["run"], expect_pass=False)
27+
assert len(results) == 7
28+
check_relations_equal(project.adapter, ["SEED", "VIEW_MODEL"])
29+
check_relations_equal(project.adapter, ["SEED", "DEP"])
30+
check_relations_equal(project.adapter, ["SEED", "TABLE_A"])
31+
check_relations_equal(project.adapter, ["SEED", "TABLE_B"])
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from dbt.tests.adapter.ephemeral.test_ephemeral import BaseEphemeralMulti
2+
from dbt.tests.util import run_dbt, check_relations_equal
3+
4+
5+
class TestEphemeralMultiSqlite(BaseEphemeralMulti):
6+
7+
def test_ephemeral_multi_sqlite(self, project):
8+
run_dbt(["seed"])
9+
results = run_dbt(["run"])
10+
assert len(results) == 3
11+
check_relations_equal(project.adapter, ["SEED", "DEPENDENT", "DOUBLE_DEPENDENT", "SUPER_DEPENDENT"])

tests/functional/adapter/test_basic.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from dbt.tests.adapter.basic.test_empty import BaseEmpty
1212
from dbt.tests.adapter.basic.test_ephemeral import BaseEphemeral
1313
from dbt.tests.adapter.basic.test_incremental import BaseIncremental
14+
from dbt.tests.adapter.basic.test_incremental import BaseIncrementalNotSchemaChange
1415
from dbt.tests.adapter.basic.test_generic_tests import BaseGenericTests
1516
from dbt.tests.adapter.basic.test_snapshot_check_cols import BaseSnapshotCheckCols
1617
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp
@@ -42,6 +43,10 @@ class TestIncrementalSqlite(BaseIncremental):
4243
pass
4344

4445

46+
class TestBaseIncrementalNotSchemaChangeSqlite(BaseIncrementalNotSchemaChange):
47+
pass
48+
49+
4550
class TestGenericTestsSqlite(BaseGenericTests):
4651
pass
4752

tests/functional/adapter/utils/test_data_types.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22
from dbt.tests.adapter.utils.data_types.test_type_bigint import BaseTypeBigInt
3+
from dbt.tests.adapter.utils.data_types.test_type_boolean import BaseTypeBoolean
34
from dbt.tests.adapter.utils.data_types.test_type_float import BaseTypeFloat
45
from dbt.tests.adapter.utils.data_types.test_type_int import BaseTypeInt
56
from dbt.tests.adapter.utils.data_types.test_type_numeric import BaseTypeNumeric
@@ -23,7 +24,13 @@
2324
class TestTypeBigInt(BaseTypeBigInt):
2425
pass
2526

26-
27+
28+
# users should imlement boolean columns as INT with values of 0 or 1
29+
@pytest.mark.skip("boolean not supported in SQLite")
30+
class TestTypeBoolean(BaseTypeBoolean):
31+
pass
32+
33+
2734
class TestTypeFloat(BaseTypeFloat):
2835

2936
models__actual_sql = """

tests/functional/adapter/utils/test_utils.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
models__test_datediff_yml,
66
)
77
from dbt.tests.adapter.utils.test_any_value import BaseAnyValue
8+
from dbt.tests.adapter.utils.test_array_append import BaseArrayAppend
9+
from dbt.tests.adapter.utils.test_array_concat import BaseArrayConcat
10+
from dbt.tests.adapter.utils.test_array_construct import BaseArrayConstruct
811
from dbt.tests.adapter.utils.test_bool_or import BaseBoolOr
912
from dbt.tests.adapter.utils.test_cast_bool_to_text import BaseCastBoolToText
1013
from dbt.tests.adapter.utils.test_concat import BaseConcat
14+
from dbt.tests.adapter.utils.test_current_timestamp import BaseCurrentTimestampNaive
1115
from dbt.tests.adapter.utils.test_dateadd import BaseDateAdd
1216
#from dbt.tests.adapter.utils.test_datediff import BaseDateDiff
1317
from dbt.tests.adapter.utils.test_date_trunc import BaseDateTrunc
@@ -31,6 +35,21 @@ class TestAnyValue(BaseAnyValue):
3135
pass
3236

3337

38+
@pytest.mark.skip("arrays not supported in SQLite")
39+
class TestArrayAppend(BaseArrayAppend):
40+
pass
41+
42+
43+
@pytest.mark.skip("arrays not supported in SQLite")
44+
class TestArrayConcat(BaseArrayConcat):
45+
pass
46+
47+
48+
@pytest.mark.skip("arrays not supported in SQLite")
49+
class TestArrayConstruct(BaseArrayConstruct):
50+
pass
51+
52+
3453
class TestBoolOr(BaseBoolOr):
3554
pass
3655

@@ -43,6 +62,11 @@ class TestConcat(BaseConcat):
4362
pass
4463

4564

65+
@pytest.mark.skip("timestamps not supported in SQLite")
66+
class TestCurrentTimestampNaive(BaseCurrentTimestampNaive):
67+
pass
68+
69+
4670
class TestDateAdd(BaseDateAdd):
4771
pass
4872

0 commit comments

Comments
 (0)