Skip to content

fix: add ephemeral wrappers so schema tests run in both dbt Core and Fusion#571

Merged
b-per merged 1 commit into
mainfrom
fix/integration-test-schema-tests-parity
Mar 24, 2026
Merged

fix: add ephemeral wrappers so schema tests run in both dbt Core and Fusion#571
b-per merged 1 commit into
mainfrom
fix/integration-test-schema-tests-parity

Conversation

@b-per
Copy link
Copy Markdown
Collaborator

@b-per b-per commented Mar 24, 2026

Summary

  • Root cause: Generic tests in dbt_project_evaluator_schema_tests/*.yml referenced package models directly. Fusion treated these as unused entries (dbt1005) and silently dropped all tests. dbt-core 1.11+ emitted MissingArgumentsPropertyInGenericTestDeprecation for tests without arguments: nesting (the project also opts in via require_generic_test_arguments_property: True).
  • Add 14 ephemeral _dpe wrapper models (select * from {{ ref('dbt_project_evaluator', '...') }}) — one per package model tested in the YAML files. Fusion recognizes these as local models and runs their tests.
  • Fix arguments: nesting for expression_is_true, unique_combination_of_columns, and two accepted_values tests to clear the deprecation warning.
  • Add /dbt_project_evaluator_schema_tests/ to exclude_paths_from_project so the wrapper models are not analyzed by the package itself (prevents metric drift in equality tests).
  • Enable require_ref_prefers_node_package_to_root flag so package-internal ref() calls resolve to the package's own models, not the root project wrappers.
  • Restrict the on_schema_change not-null test to materialized = 'incremental' — Fusion sets on_schema_change = null for non-incremental models while Core defaults to 'ignore'.
  • Update the BigQuery disable config to reference the renamed test node (unique_int_all_dag_relationships_dpe_path).

Test plan

  • fs parse — no dbt1005: Unused schema.yml entry warnings
  • dbt parse — no MissingArgumentsPropertyInGenericTestDeprecation warnings
  • fs list --select test_type:generic — all wrapper model tests visible in Fusion
  • fs build --static-analysis=off --full-refresh --vars '{"deactivate_for_fusion": true}' passes on DuckDB
  • CI passes on all adapters (Core + Fusion)

…d Fusion

Previously, generic tests in dbt_project_evaluator_schema_tests/*.yml were
silently dropped by Fusion (dbt1005: Unused schema.yml entry) because the
referenced models belonged to the package, not the local project. The tests
also emitted MissingArgumentsPropertyInGenericTestDeprecation in dbt-core 1.11+.

- Add _dpe ephemeral wrapper models (select * from ref('dbt_project_evaluator', '...'))
  for each package model tested in core.yml, graph.yml, and tests.yml
- Nest generic test arguments under arguments: to fix the deprecation warning
- Add /dbt_project_evaluator_schema_tests/ to exclude_paths_from_project so
  the wrapper models are not analyzed by the package itself
- Restrict on_schema_change not_null test to incremental models only, since
  Fusion sets on_schema_change=null for non-incremental models (Core uses 'ignore')
- Update BigQuery disable config to reference the renamed test node
- Enable require_ref_prefers_node_package_to_root flag to prevent package
  models from accidentally resolving refs to root project models
@b-per b-per requested review from a team, dave-connors-3 and graciegoheen as code owners March 24, 2026 11:22
@b-per
Copy link
Copy Markdown
Collaborator Author

b-per commented Mar 24, 2026

Closes #569

@b-per b-per merged commit 87b457c into main Mar 24, 2026
9 checks passed
@b-per b-per deleted the fix/integration-test-schema-tests-parity branch March 24, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant