Skip to content

Commit ce88249

Browse files
committed
isolate dialect tests
1 parent 299ae6e commit ce88249

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ engine-up: engine-clickhouse-up engine-mssql-up engine-mysql-up engine-postgres-
117117
engine-down: engine-clickhouse-down engine-mssql-down engine-mysql-down engine-postgres-down engine-spark-down engine-trino-down
118118

119119
fast-test:
120-
pytest -n auto -m "fast and not cicdonly" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated" && pytest -m "registry_isolation"
120+
pytest -n auto -m "fast and not cicdonly" --junitxml=test-results/junit-fast-test.xml && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
121121

122122
slow-test:
123-
pytest -n auto -m "(fast or slow) and not cicdonly" && pytest -m "isolated" && pytest -m "registry_isolation"
123+
pytest -n auto -m "(fast or slow) and not cicdonly" && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
124124

125125
cicd-test:
126-
pytest -n auto -m "fast or slow" --junitxml=test-results/junit-cicd.xml && pytest -m "isolated" && pytest -m "registry_isolation"
126+
pytest -n auto -m "fast or slow" --junitxml=test-results/junit-cicd.xml && pytest -m "isolated" && pytest -m "registry_isolation" && pytest -m "dialect_isolated"
127127

128128
core-fast-test:
129129
pytest -n auto -m "fast and not web and not github and not dbt and not jupyter"

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ markers = [
241241
"remote: test that involves interacting with a remote DB",
242242
"cicdonly: test that only runs on CI/CD",
243243
"isolated: tests that need to run sequentially usually because they use fork",
244+
"dialect_isolated: tests that need to run separately due to global dialect overrides",
244245

245246
# Test Domain Markers
246247
# default: core functionality

tests/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,15 @@ def validate(
202202

203203

204204
def pytest_collection_modifyitems(items, *args, **kwargs):
205-
test_type_markers = {"fast", "slow", "docker", "remote", "isolated", "registry_isolation"}
205+
test_type_markers = {
206+
"fast",
207+
"slow",
208+
"docker",
209+
"remote",
210+
"isolated",
211+
"registry_isolation",
212+
"dialect_isolated",
213+
}
206214
for item in items:
207215
for marker in item.iter_markers():
208216
if marker.name in test_type_markers:

tests/core/test_dialect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from sqlmesh.core.model import SqlModel, load_sql_based_model
1717
from sqlmesh.core.config.connection import DIALECT_TO_TYPE
1818

19+
pytestmark = pytest.mark.dialect_isolated
20+
1921

2022
def test_format_model_expressions():
2123
x = format_model_expressions(

0 commit comments

Comments
 (0)