Skip to content

chore: serialize engine integration tests #2245

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

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ markers =
spark: test for Spark
trino: test for Trino (Hive connector)
trino_iceberg: test for Trino (Iceberg connector)
addopts = -n 0 --dist=worksteal
addopts = -n 0 --dist=loadgroup

# Set this to True to enable logging during tests
log_cli = False
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,8 @@
# https://github.com/dpgaspar/Flask-AppBuilder/blob/master/requirements.txt#L25
"pydantic<2.6.0",
"PyGithub",
# 8.0.0 broke compatability with lazy-fixture
"pytest<8.0.0",
"pytest",
"pytest-asyncio<0.23.0",
"pytest-lazy-fixture",
"pytest-mock",
"pytest-xdist",
"pyspark==3.4.0",
Expand Down
12 changes: 12 additions & 0 deletions tests/core/engine_adapter/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def config() -> Config:
pytest.mark.duckdb,
pytest.mark.engine,
pytest.mark.slow,
pytest.mark.xdist_group("engine_integration_duckdb"),
],
),
pytest.param(
Expand All @@ -410,6 +411,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.postgres,
pytest.mark.xdist_group("engine_integration_postgres"),
],
),
pytest.param(
Expand All @@ -418,6 +420,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.mysql,
pytest.mark.xdist_group("engine_integration_mysql"),
],
),
pytest.param(
Expand All @@ -426,6 +429,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.mssql,
pytest.mark.xdist_group("engine_integration_mssql"),
],
),
pytest.param(
Expand All @@ -434,6 +438,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.trino,
pytest.mark.xdist_group("engine_integration_trino"),
],
),
pytest.param(
Expand All @@ -442,6 +447,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.trino_iceberg,
pytest.mark.xdist_group("engine_integration_trino_iceberg"),
],
),
pytest.param(
Expand All @@ -450,6 +456,7 @@ def config() -> Config:
pytest.mark.docker,
pytest.mark.engine,
pytest.mark.spark,
pytest.mark.xdist_group("engine_integration_spark"),
],
),
pytest.param(
Expand All @@ -458,6 +465,7 @@ def config() -> Config:
pytest.mark.bigquery,
pytest.mark.engine,
pytest.mark.remote,
pytest.mark.xdist_group("engine_integration_bigquery"),
],
),
pytest.param(
Expand All @@ -466,6 +474,7 @@ def config() -> Config:
pytest.mark.databricks,
pytest.mark.engine,
pytest.mark.remote,
pytest.mark.xdist_group("engine_integration_databricks"),
],
),
pytest.param(
Expand All @@ -474,6 +483,7 @@ def config() -> Config:
pytest.mark.motherduck,
pytest.mark.engine,
pytest.mark.remote,
pytest.mark.xdist_group("engine_integration_motherduck"),
],
),
pytest.param(
Expand All @@ -482,6 +492,7 @@ def config() -> Config:
pytest.mark.engine,
pytest.mark.remote,
pytest.mark.redshift,
pytest.mark.xdist_group("engine_integration_redshift"),
],
),
pytest.param(
Expand All @@ -490,6 +501,7 @@ def config() -> Config:
pytest.mark.engine,
pytest.mark.remote,
pytest.mark.snowflake,
pytest.mark.xdist_group("engine_integration_snowflake"),
],
),
]
Expand Down
32 changes: 21 additions & 11 deletions tests/core/test_connection_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import typing as t

import pytest
from pytest_lazyfixture import lazy_fixture
from _pytest.fixtures import FixtureRequest

from sqlmesh.core.config.connection import (
BigQueryConnectionConfig,
Expand Down Expand Up @@ -181,27 +181,37 @@ def test_snowflake(make_config, snowflake_key_passphrase_bytes, snowflake_oauth_


@pytest.mark.parametrize(
"key_path, key_pem, key_b64, key_bytes, key_passphrase",
"key_path_fixture, key_pem_fixture, key_b64_fixture, key_bytes_fixture, key_passphrase",
[
(
lazy_fixture("snowflake_key_no_passphrase_path"),
lazy_fixture("snowflake_key_no_passphrase_pem"),
lazy_fixture("snowflake_key_no_passphrase_b64"),
lazy_fixture("snowflake_key_no_passphrase_bytes"),
"snowflake_key_no_passphrase_path",
"snowflake_key_no_passphrase_pem",
"snowflake_key_no_passphrase_b64",
"snowflake_key_no_passphrase_bytes",
None,
),
(
lazy_fixture("snowflake_key_passphrase_path"),
lazy_fixture("snowflake_key_passphrase_pem"),
lazy_fixture("snowflake_key_passphrase_b64"),
lazy_fixture("snowflake_key_passphrase_bytes"),
"snowflake_key_passphrase_path",
"snowflake_key_passphrase_pem",
"snowflake_key_passphrase_b64",
"snowflake_key_passphrase_bytes",
"insecure",
),
],
)
def test_snowflake_private_key_pass(
make_config, key_path, key_pem, key_b64, key_bytes, key_passphrase
make_config,
key_path_fixture,
key_pem_fixture,
key_b64_fixture,
key_bytes_fixture,
key_passphrase,
request: FixtureRequest,
):
key_path = request.getfixturevalue(key_path_fixture)
key_pem = request.getfixturevalue(key_pem_fixture)
key_b64 = request.getfixturevalue(key_b64_fixture)
key_bytes = request.getfixturevalue(key_bytes_fixture)
common_kwargs = dict(
type="snowflake",
account="test",
Expand Down
1 change: 1 addition & 0 deletions tests/dbt/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def test_tests_referencing_disabled_models():
assert "not_null_disabled_model_one" not in helper.tests()


@pytest.mark.xdist_group("dbt_manifest")
def test_variable_override():
project_path = Path("tests/fixtures/dbt/sushi_test")
profile = Profile.load(DbtContext(project_path))
Expand Down
Loading