Skip to content

Commit

Permalink
mark high memory tests and run as a separate pytest run
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Dec 18, 2024
1 parent 764dbdd commit 37d2dae
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
9 changes: 3 additions & 6 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 .",
Expand Down
9 changes: 1 addition & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 3 additions & 0 deletions tests/functional/adapter/dbt_clone/test_dbt_clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 4 additions & 0 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
model_contract_header_schema_yml,
)


pytestmark = pytest.mark.high_memory


my_model_contract_sql_header_sql = """
{{
config(
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/adapter/test_grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions tests/functional/adapter/unit_testing/test_unit_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
63 changes: 0 additions & 63 deletions tests/functional/conftest.py

This file was deleted.

0 comments on commit 37d2dae

Please sign in to comment.