diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index ab23a7de8..b939e2581 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -148,7 +148,7 @@ jobs: - name: Install python dependencies uses: pypa/hatch@install - - run: hatch run integration-tests --ddtrace + - run: hatch run integration-tests tests/functional --ddtrace env: SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }} SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }} diff --git a/hatch.toml b/hatch.toml index 5543df3a1..35410dc3f 100644 --- a/hatch.toml +++ b/hatch.toml @@ -8,6 +8,7 @@ packages = ["dbt"] packages = ["dbt"] [envs.default] +python = "3.9" dependencies = [ "dbt-adapters @ git+https://github.com/dbt-labs/dbt-adapters.git", "dbt-common @ git+https://github.com/dbt-labs/dbt-common.git", @@ -28,12 +29,8 @@ setup = "pre-commit install" code-quality = "pre-commit run --all-files" unit-tests = "python -m pytest {args:tests/unit}" integration-tests = [ - '- python -m pytest {args:tests/functional} -m "last_year"', - '- python -m pytest {args:tests/functional} -m "last_quarter"', - '- python -m pytest {args:tests/functional} -m "last_month"', - '- python -m pytest {args:tests/functional} -m "microbatch"', - '- python -m pytest {args:tests/functional} -m "python_model"', - '- python -m pytest {args:tests/functional} -m "large"', + '- python -m pytest {args:tests/functional} -m "not high_memory"', + '- python -m pytest {args:tests/functional} -m "high_memory"', ] docker-dev = [ "docker build -f docker/dev.Dockerfile -t dbt-snowflake-dev .", diff --git a/pyproject.toml b/pyproject.toml index cb24785a4..faab5c084 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,11 +46,4 @@ addopts = "-v --color=yes -n auto" filterwarnings = [ "ignore:datetime.datetime.utcnow:DeprecationWarning", ] -markers = [ - "last_year", - "last_quarter", - "last_month", - "microbatch", - "python_model", - "large", -] +markers = ["high_memory"] diff --git a/tests/functional/adapter/dbt_clone/test_dbt_clone.py b/tests/functional/adapter/dbt_clone/test_dbt_clone.py index 2a73eb7f4..b7911ac76 100644 --- a/tests/functional/adapter/dbt_clone/test_dbt_clone.py +++ b/tests/functional/adapter/dbt_clone/test_dbt_clone.py @@ -6,6 +6,9 @@ from dbt.tests.adapter.dbt_clone.test_dbt_clone import BaseClonePossible +pytestmark = pytest.mark.high_memory + + class TestSnowflakeClonePossible(BaseClonePossible): @pytest.fixture(autouse=True) def clean_up(self, project): diff --git a/tests/functional/adapter/test_constraints.py b/tests/functional/adapter/test_constraints.py index 03adc3bed..2ba7c2667 100644 --- a/tests/functional/adapter/test_constraints.py +++ b/tests/functional/adapter/test_constraints.py @@ -18,6 +18,10 @@ model_contract_header_schema_yml, ) + +pytestmark = pytest.mark.high_memory + + my_model_contract_sql_header_sql = """ {{ config( diff --git a/tests/functional/adapter/test_grants.py b/tests/functional/adapter/test_grants.py index 30e687f59..9cfde9990 100644 --- a/tests/functional/adapter/test_grants.py +++ b/tests/functional/adapter/test_grants.py @@ -6,6 +6,9 @@ from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants +pytestmark = pytest.mark.high_memory + + class BaseCopyGrantsSnowflake: # Try every test case without copy_grants enabled (default), # and with copy_grants enabled (this base class) diff --git a/tests/functional/adapter/unit_testing/test_unit_testing.py b/tests/functional/adapter/unit_testing/test_unit_testing.py index b97be0ac2..316976955 100644 --- a/tests/functional/adapter/unit_testing/test_unit_testing.py +++ b/tests/functional/adapter/unit_testing/test_unit_testing.py @@ -5,6 +5,9 @@ from dbt.tests.adapter.unit_testing.test_invalid_input import BaseUnitTestInvalidInput +pytestmark = pytest.mark.high_memory + + class TestSnowflakeUnitTestingTypes(BaseUnitTestingTypes): @pytest.fixture def data_types(self): diff --git a/tests/functional/conftest.py b/tests/functional/conftest.py deleted file mode 100644 index eb1a992bd..000000000 --- a/tests/functional/conftest.py +++ /dev/null @@ -1,63 +0,0 @@ -import pathlib - -import pytest - - -TEST_GROUPS = { - "catalog_tests": "last_year", - "column_types": "last_year", - "custom_schema_tests": "last_year", - "dbt_clone": "last_quarter", - "dbt_show": "last_quarter", - "empty": "last_quarter", - "incremental": "microbatch", - "list_relations_tests": "last_month", - "python_model_tests": "python_model", - "query_comment_tests": "last_year", - "simple_copy": "last_year", - "simple_seed": "last_year", - "statement_test": "last_year", - "store_test_failures_tests": "last_year", - "unit_testing": "last_year", - "utils": "last_year", - "test_aliases.py": "last_year", - "test_anonymous_usage_stats.py": "last_year", - "test_basic.py": "last_year", - "test_caching.py": "last_year", - "test_changing_relation_type.py": "large", - "test_concurrency.py": "last_year", - "test_constraints.py": "last_year", - "test_ephemeral.py": "last_year", - "test_get_last_relation_modified.py": "last_year", - "test_grants.py": "last_year", - "test_incremental_microbatch.py": "microbatch", - "test_persist_docs.py": "last_year", - "test_python_model.py": "python_model", - "test_simple_snapshot.py": "last_year", - "test_timestamps.py": "last_year", - "auth_tests": "last_month", - "generic_test_tests": "last_month", - "iceberg": "last_month", - "override_database": "last_year", - "query_tag": "last_month", - "redact_log_values": "last_year", - "relation_tests": "last_month", - "snowflake_view_dependency": "last_year", - "warehouse_test": "last_quarter", - "test_isolated_begin_commit.py": "last_year", -} - - -def pytest_collection_modifyitems(config, items): - test_root = pathlib.Path(config.rootdir) / "tests" / "functional" - for item in items: - try: - test_path = pathlib.Path(item.fspath).relative_to(test_root) - except ValueError: - continue - test_module = test_path.parts[0] - if test_module == "adapter": - test_module = test_path.parts[1] - if mark_name := TEST_GROUPS.get(test_module): - mark = getattr(pytest.mark, mark_name) - item.add_marker(mark)