Skip to content

Add unit tests across all models#1293

Open
chase-jones wants to merge 4 commits intomainfrom
adding-unit-tests
Open

Add unit tests across all models#1293
chase-jones wants to merge 4 commits intomainfrom
adding-unit-tests

Conversation

@chase-jones
Copy link
Copy Markdown
Member

@chase-jones chase-jones commented Mar 27, 2026

  • Add local DuckDB profile for running tests without MotherDuck
  • Add 826 unit tests across all data marts, core, claims preprocessing, input layer, normalization, and data quality models
  • All 826 tests pass on DuckDB with zero errors
  • Unit tests disabled by default via tuva_unit_tests_enabled var so they don't run in customer pipelines; set tuva_unit_tests_enabled: true to enable
  • Add GitHub Actions workflow for unit tests on PRs (DuckDB-based)
  • Add CI check that warns when new models lack unit test coverage

- Fix CCSR staging model to SELECT DISTINCT, preventing duplicate
  ccsr_category_rank=1 records when claims have multiple line items
  with the same diagnosis code
- Add local DuckDB profile for running tests without MotherDuck
- Add 826 unit tests across all data marts, core, claims preprocessing,
  input layer, normalization, and data quality models
- All 826 tests pass on DuckDB with zero errors
- Unit tests disabled by default via tuva_unit_tests_enabled var so they
  don't run in customer pipelines; set tuva_unit_tests_enabled: true to
  enable
- Add GitHub Actions workflow for unit tests on PRs (DuckDB-based)
- Add CI check that warns when new models lack unit test coverage
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 27, 2026

Deploy Preview for thetuvaproject canceled.

Name Link
🔨 Latest commit b00bfd7
🔍 Latest deploy log https://app.netlify.com/projects/thetuvaproject/deploys/69cace8adfcf1500080ee839

The normalize staging models require enable_normalize_engine var which
defaults to false. dbt 1.10 raises a parse error when unit tests
reference disabled models, even if the tests themselves are disabled.
The chronic_conditions__cms_chronic_conditions_wide model fails with
dbt run --empty because the pivot macro receives no rows. This doesn't
affect unit tests (920/921 models build fine) but would fail the CI step.
@chase-jones
Copy link
Copy Markdown
Member Author

/ci medium

@github-actions
Copy link
Copy Markdown

Unsupported warehouse medium. Supported warehouses: snowflake, bigquery, databricks, fabric, redshift, duckdb. Examples: /ci, /ci snowflake dbt run, /ci dbt seed --select tag:tuva_demo.

@chase-jones
Copy link
Copy Markdown
Member Author

/ci snowflake dbt run

@chase-jones
Copy link
Copy Markdown
Member Author

/ci snowflake dbt test

@github-actions
Copy link
Copy Markdown

Triggered Tuva CI with snowflake: dbt run (ref: main).

@github-actions
Copy link
Copy Markdown

Triggered Tuva CI with snowflake: dbt test (ref: main).

@chase-jones
Copy link
Copy Markdown
Member Author

/ci snowflake dbt build --full-refresh

@github-actions
Copy link
Copy Markdown

Triggered Tuva CI with snowflake: dbt build --full-refresh (ref: main).

@aneiderhiser
Copy link
Copy Markdown
Collaborator

the distinct on CCSR doesn't fix this problem (and it's not clear it actually is a problem per slack thread) and should be reverted

@chase-jones chase-jones changed the title Add unit tests across all models and fix CCSR duplicate diagnosis bug Add unit tests across all models Mar 30, 2026
Comment thread models/data_marts/ccsr/staging/ccsr__stg_core__condition.sql Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 Ready for Review

Development

Successfully merging this pull request may close these issues.

2 participants