Repository navigation
refactor(unit-tests): exercise dict + csv + sql fixture formats across the 3 cute-dbt dogfooding tests - #291
Merged
Conversation
…s the 3 cute-dbt dogfooding tests Follow-up to #290 (cute-dbt#39 dogfooding). Surfaced visually: cmbays/cute-dbt's renderer currently shows "Fixture uses format: sql — not yet visualized" for the sql-format mocks, AND I had previously chosen sql for ALL three tests to avoid the upstream-introspection prerequisite for dict/csv. That choice defeated the format-coverage demonstration the tests were meant to provide. This PR re-authors the 3 tests so each test uses a different fixture format end-to-end: | Test | Given | Expect | Demonstrates | |---|---|---|---| | test_dim_payers_injects_unknown_sentinel | dict | dict | Key-value mock for ~22 columns | | test_mart_dq_summary_combines_encounter_and_medication_metrics | csv | csv | Tabular boolean grid | | test_mart_dq_summary_zero_quarantined_when_all_valid | sql | dict | Inline SELECT with explicit casts | The dict and csv `given` blocks introspect the upstream model's schema (to NULL-fill unspecified columns), which requires the upstream relation to exist in the warehouse. Adds a `## Unit tests (cute-dbt format coverage)` section to `dbt_project/README.md` documenting the persistent-DuckDB target prerequisite + the exact 3-command workflow to run them. All 3 tests pass locally against dbt-core 1.11.11 with a persistent DuckDB target seeded via `run-operation load_synthea_sources`: $ dbt test --select "test_type:unit" --target unit_test PASS=3 WARN=0 ERROR=0 SKIP=0 NO-OP=0 TOTAL=3 Closes the cute-dbt-side gap that motivated cute-dbt#66 (fixture format rendering for csv + sql). cute-dbt's follow-up PR ships the matching renderer fix + regenerated playground fixture against this PR's merge commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #290. The three unit_tests authored in #290 all used
format: sqlforgivento avoid the upstream-introspection prerequisite that dict/csv require. Visual review of the rendered cute-dbt report surfaced two problems:This PR re-authors the three tests so each demonstrates a different fixture format end-to-end.
Changes
test_dim_payers_injects_unknown_sentineltest_mart_dq_summary_combines_encounter_and_medication_metricstest_mart_dq_summary_zero_quarantined_when_all_validPlus
dbt_project/README.mdgains a new## Unit tests (cute-dbt format coverage)section documenting the persistent-DuckDB target prerequisite (dict + csvgivenrequire the upstream relation to exist in the warehouse — easiest via a file-backed DuckDB target +run-operation load_synthea_sources).Related Issues
Related to:
Type of Change
Testing
All 3 tests pass via dbt-core 1.11.11 against a persistent DuckDB target:
Manual Testing
UI-specific test items (Chrome/Firefox/Safari/localStorage) are N/A — this PR only modifies dbt YAML + README.
Specific Test Cases
_generated_atcolumn.🤖 Generated with Claude Code