Skip to content
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

Setup shared tests #18

Merged
merged 15 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ all = "python -m pytest {args:tests/unit}"
[tool.hatch.envs.integration-tests]
template = "unit-tests"
extra-dependencies = [
"dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter",
"dbt-tests-adapter @ git+https://github.com/dbt-labs/dbt-adapters.git@setup-shared-tests#subdirectory=dbt-tests-adapter",
mikealfare marked this conversation as resolved.
Show resolved Hide resolved
]
[tool.hatch.envs.integration-tests.scripts]
all = "python -m pytest {args:tests/functional}"
Expand Down Expand Up @@ -130,7 +130,7 @@ target-version = ['py38']
[tool.flake8]
select = ["E", "W", "F"]
ignore = ["E203", "E501", "E741", "W503", "W504"]
exclude = ["tests", "venv"]
exclude = ["tests", "venv", ".hatch_venvs"]
per-file-ignores = ["*/__init__.py: F401"]

[tool.mypy]
Expand All @@ -145,7 +145,8 @@ files = [
]
exclude = [
"tests/functional",
"venv"
"venv",
".hatch_venvs",
]

[tool.pytest]
Expand Down
1 change: 1 addition & 0 deletions tests/functional/shared_tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# this file namespaces the test files within to avoid naming collision for the test collector
22 changes: 22 additions & 0 deletions tests/functional/shared_tests/test_aliases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from dbt.tests.adapter.aliases.test_aliases import (
BaseAliases,
BaseAliasErrors,
BaseSameAliasDifferentSchemas,
BaseSameAliasDifferentDatabases,
)


class TestAliases(BaseAliases):
pass


class TestAliasErrors(BaseAliasErrors):
pass


class TestSameAliasDifferentSchemas(BaseSameAliasDifferentSchemas):
pass


class TestSameAliasDifferentDatabases(BaseSameAliasDifferentDatabases):
pass
79 changes: 79 additions & 0 deletions tests/functional/shared_tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod
from dbt.tests.adapter.basic.test_base import BaseSimpleMaterializations
from dbt.tests.adapter.basic.test_docs_generate import (
BaseDocsGenerate,
BaseDocsGenReferences,
)
from dbt.tests.adapter.basic.test_empty import BaseEmpty
from dbt.tests.adapter.basic.test_ephemeral import BaseEphemeral
from dbt.tests.adapter.basic.test_generic_tests import BaseGenericTests
from dbt.tests.adapter.basic.test_incremental import (
BaseIncremental,
BaseIncrementalNotSchemaChange,
)
from dbt.tests.adapter.basic.test_singular_tests import BaseSingularTests
from dbt.tests.adapter.basic.test_singular_tests_ephemeral import BaseSingularTestsEphemeral
from dbt.tests.adapter.basic.test_snapshot_check_cols import BaseSnapshotCheckCols
from dbt.tests.adapter.basic.test_snapshot_timestamp import BaseSnapshotTimestamp
from dbt.tests.adapter.basic.test_table_materialization import BaseTableMaterialization
from dbt.tests.adapter.basic.test_validate_connection import BaseValidateConnection


class TestBaseCaching(BaseAdapterMethod):
pass


class TestSimpleMaterializations(BaseSimpleMaterializations):
pass


class TestDocsGenerate(BaseDocsGenerate):
pass


class TestDocsGenReferences(BaseDocsGenReferences):
pass


class TestEmpty(BaseEmpty):
pass


class TestEphemeral(BaseEphemeral):
pass


class TestGenericTests(BaseGenericTests):
pass


class TestIncremental(BaseIncremental):
pass


class TestBaseIncrementalNotSchemaChange(BaseIncrementalNotSchemaChange):
pass


class TestSingularTests(BaseSingularTests):
pass


class TestSingularTestsEphemeral(BaseSingularTestsEphemeral):
pass


class TestSnapshotCheckCols(BaseSnapshotCheckCols):
pass


class TestSnapshotTimestamp(BaseSnapshotTimestamp):
pass


class TestTableMat(BaseTableMaterialization):
pass


class TestValidateConnection(BaseValidateConnection):
pass
22 changes: 22 additions & 0 deletions tests/functional/shared_tests/test_caching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from dbt.tests.adapter.caching.test_caching import (
BaseCachingLowercaseModel,
BaseCachingSelectedSchemaOnly,
BaseCachingUppercaseModel,
BaseNoPopulateCache,
)


class TestCachingLowerCaseModel(BaseCachingLowercaseModel):
pass


class TestCachingUppercaseModel(BaseCachingUppercaseModel):
pass


class TestCachingSelectedSchemaOnly(BaseCachingSelectedSchemaOnly):
pass


class TestNoPopulateCache(BaseNoPopulateCache):
pass
17 changes: 17 additions & 0 deletions tests/functional/shared_tests/test_clone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from dbt.tests.adapter.dbt_clone.test_dbt_clone import (
BaseCloneNotPossible,
BaseClonePossible,
BaseCloneSameTargetAndState,
)


class TestBaseCloneNotPossible(BaseCloneNotPossible):
pass


class TestBaseClonePossible(BaseClonePossible):
pass


class TestCloneSameTargetAndState(BaseCloneSameTargetAndState):
pass
5 changes: 5 additions & 0 deletions tests/functional/shared_tests/test_column_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.column_types.test_column_types import BaseColumnTypes


class TestPostgresColumnTypes(BaseColumnTypes):
pass
5 changes: 5 additions & 0 deletions tests/functional/shared_tests/test_concurrency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.concurrency.test_concurrency import BaseConcurrency


class TestConcurrency(BaseConcurrency):
pass
64 changes: 64 additions & 0 deletions tests/functional/shared_tests/test_constraints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
from dbt.tests.adapter.constraints.test_constraints import (
BaseTableConstraintsColumnsEqual,
BaseViewConstraintsColumnsEqual,
BaseIncrementalConstraintsColumnsEqual,
BaseConstraintsRuntimeDdlEnforcement,
BaseConstraintsRollback,
BaseIncrementalConstraintsRuntimeDdlEnforcement,
BaseIncrementalConstraintsRollback,
BaseTableContractSqlHeader,
BaseIncrementalContractSqlHeader,
BaseModelConstraintsRuntimeEnforcement,
BaseConstraintQuotedColumn,
BaseIncrementalForeignKeyConstraint,
)


class TestTableConstraintsColumnsEqual(BaseTableConstraintsColumnsEqual):
pass


class TestViewConstraintsColumnsEqual(BaseViewConstraintsColumnsEqual):
pass


class TestIncrementalConstraintsColumnsEqual(BaseIncrementalConstraintsColumnsEqual):
pass


class TestTableConstraintsRuntimeDdlEnforcement(BaseConstraintsRuntimeDdlEnforcement):
pass


class TestTableConstraintsRollback(BaseConstraintsRollback):
pass


class TestIncrementalConstraintsRuntimeDdlEnforcement(
BaseIncrementalConstraintsRuntimeDdlEnforcement
):
pass


class TestIncrementalConstraintsRollback(BaseIncrementalConstraintsRollback):
pass


class TestTableContractSqlHeader(BaseTableContractSqlHeader):
pass


class TestIncrementalContractSqlHeader(BaseIncrementalContractSqlHeader):
pass


class TestModelConstraintsRuntimeEnforcement(BaseModelConstraintsRuntimeEnforcement):
pass


class TestConstraintQuotedColumn(BaseConstraintQuotedColumn):
pass


class TestIncrementalForeignKeyConstraint(BaseIncrementalForeignKeyConstraint):
pass
35 changes: 35 additions & 0 deletions tests/functional/shared_tests/test_data_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from dbt.tests.adapter.utils.data_types.test_type_bigint import BaseTypeBigInt
from dbt.tests.adapter.utils.data_types.test_type_boolean import BaseTypeBoolean
from dbt.tests.adapter.utils.data_types.test_type_float import BaseTypeFloat
from dbt.tests.adapter.utils.data_types.test_type_int import BaseTypeInt
from dbt.tests.adapter.utils.data_types.test_type_numeric import BaseTypeNumeric
from dbt.tests.adapter.utils.data_types.test_type_string import BaseTypeString
from dbt.tests.adapter.utils.data_types.test_type_timestamp import BaseTypeTimestamp


class TestTypeBigInt(BaseTypeBigInt):
pass


class TestTypeBoolean(BaseTypeBoolean):
pass


class TestTypeFloat(BaseTypeFloat):
pass


class TestTypeInt(BaseTypeInt):
pass


class TestTypeNumeric(BaseTypeNumeric):
pass


class TestTypeString(BaseTypeString):
pass


class TestTypeTimestamp(BaseTypeTimestamp):
pass
12 changes: 12 additions & 0 deletions tests/functional/shared_tests/test_debug.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from dbt.tests.adapter.dbt_debug.test_dbt_debug import (
BaseDebugPostgres,
BaseDebugInvalidProjectPostgres,
)


class TestDebugPostgres(BaseDebugPostgres):
pass


class TestDebugInvalidProjectPostgres(BaseDebugInvalidProjectPostgres):
pass
5 changes: 5 additions & 0 deletions tests/functional/shared_tests/test_empty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dbt.tests.adapter.empty.test_empty import BaseTestEmpty


class TestEmpty(BaseTestEmpty):
pass
17 changes: 17 additions & 0 deletions tests/functional/shared_tests/test_ephemeral.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from dbt.tests.adapter.ephemeral.test_ephemeral import (
BaseEphemeralMulti,
BaseEphemeralNested,
BaseEphemeralErrorHandling,
)


class TestEphemeralMulti(BaseEphemeralMulti):
pass


class TestEphemeralNested(BaseEphemeralNested):
pass


class TestEphemeralErrorHandling(BaseEphemeralErrorHandling):
pass
25 changes: 25 additions & 0 deletions tests/functional/shared_tests/test_grants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from dbt.tests.adapter.grants.test_incremental_grants import BaseIncrementalGrants
from dbt.tests.adapter.grants.test_invalid_grants import BaseInvalidGrants
from dbt.tests.adapter.grants.test_model_grants import BaseModelGrants
from dbt.tests.adapter.grants.test_seed_grants import BaseSeedGrants
from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants


class TestIncrementalGrants(BaseIncrementalGrants):
pass


class TestInvalidGrants(BaseInvalidGrants):
pass


class TestModelGrants(BaseModelGrants):
pass


class TestSeedGrants(BaseSeedGrants):
pass


class TestSnapshotGrants(BaseSnapshotGrants):
pass
Loading
Loading