From b4c1acdeb4e3bb2ee57151bd12b05cb82c2228f1 Mon Sep 17 00:00:00 2001 From: Daniel Song Date: Mon, 30 Mar 2026 02:05:53 -0700 Subject: [PATCH] ci: re-enable 3 excluded test files in CI and Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix test_dbt_config_validators.py: migrate parse_obj → model_validate (Pydantic v1 → v2 API) - Fix dbt_config_validators.py: add default=None for Optional fields (test_metadata, project_id, user_id) to match Pydantic v2 semantics - Remove --ignore flags for test_database_types.py, test_main.py, and test_dbt_config_validators.py from ci.yml, ci_full.yml, and Makefile - test_database_types.py and test_main.py self-filter based on available database connections, so they are safe to include in CI Closes #31 Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 5 +---- .github/workflows/ci_full.yml | 5 +---- Makefile | 5 +---- data_diff/dbt_config_validators.py | 6 +++--- tests/test_dbt_config_validators.py | 4 ++-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be233755..9be021c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,4 @@ jobs: DATADIFF_CLICKHOUSE_URI: "clickhouse://clickhouse:Password1@localhost:9000/clickhouse" run: | uv run pytest tests/ \ - -o addopts="--timeout=300 --tb=short" \ - --ignore=tests/test_database_types.py \ - --ignore=tests/test_dbt_config_validators.py \ - --ignore=tests/test_main.py + -o addopts="--timeout=300 --tb=short" diff --git a/.github/workflows/ci_full.yml b/.github/workflows/ci_full.yml index fc25515c..b524dbb4 100644 --- a/.github/workflows/ci_full.yml +++ b/.github/workflows/ci_full.yml @@ -41,7 +41,4 @@ jobs: DATADIFF_CLICKHOUSE_URI: "clickhouse://clickhouse:Password1@localhost:9000/clickhouse" run: | uv run pytest tests/ \ - -o addopts="--timeout=300 --tb=short" \ - --ignore=tests/test_database_types.py \ - --ignore=tests/test_dbt_config_validators.py \ - --ignore=tests/test_main.py + -o addopts="--timeout=300 --tb=short" diff --git a/Makefile b/Makefile index b7e636f8..4be61b44 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,7 @@ test-unit: ## export DATADIFF_VERTICA_URI="vertica://vertica:Password1@localhost:5433/vertica" test: up uv run pytest tests/ \ - -o addopts="--timeout=300 --tb=short" \ - --ignore=tests/test_database_types.py \ - --ignore=tests/test_dbt_config_validators.py \ - --ignore=tests/test_main.py + -o addopts="--timeout=300 --tb=short" ## Run data-diff against seed data to showcase diffing demo: up diff --git a/data_diff/dbt_config_validators.py b/data_diff/dbt_config_validators.py index 77a53ecf..ab28960e 100644 --- a/data_diff/dbt_config_validators.py +++ b/data_diff/dbt_config_validators.py @@ -7,8 +7,8 @@ class ManifestJsonConfig(BaseModel): class Metadata(BaseModel): dbt_version: str = Field(..., pattern=r"^\d+\.\d+\.\d+([a-zA-Z0-9]+)?$") - project_id: str | None - user_id: str | None + project_id: str | None = None + user_id: str | None = None class Nodes(BaseModel): class Config(BaseModel): @@ -38,7 +38,7 @@ class DependsOn(BaseModel): meta: dict[str, Any] config: Config tags: list[str] - test_metadata: TestMetadata | None + test_metadata: TestMetadata | None = None depends_on: DependsOn metadata: Metadata diff --git a/tests/test_dbt_config_validators.py b/tests/test_dbt_config_validators.py index 33abbd4f..02d9a100 100644 --- a/tests/test_dbt_config_validators.py +++ b/tests/test_dbt_config_validators.py @@ -19,7 +19,7 @@ def test_run_results(self): for version in versions: with self.subTest(version=version): with open(Path(RUN_RESULTS_PATH, f"run_results_{version}.json"), encoding="utf-8") as run_results: - RunResultsJsonConfig.parse_obj(json.load(run_results)) + RunResultsJsonConfig.model_validate(json.load(run_results)) class TestManifestJsonConfig(unittest.TestCase): @@ -30,4 +30,4 @@ def test_manifest(self): for version in versions: with self.subTest(version=version): with open(Path(MANIFEST_PATH, f"manifest_{version}.json"), encoding="utf-8") as manifest: - ManifestJsonConfig.parse_obj(json.load(manifest)) + ManifestJsonConfig.model_validate(json.load(manifest))