altimate-code
altimate-code copied to clipboard
feat: automated dbt unit test generation
Add a dbt_unit_test_gen tool and dbt-unit-tests skill that generates dbt unit tests from manifest + compiled SQL.
Problem
dbt unit testing (shipped v1.8) has near-zero adoption because writing test YAML is tedious — you must identify every upstream ref, mock each with correct column types, and manually compute expected outputs.
Solution
A tool that:
- Parses manifest for model info, deps, columns, descriptions
- Uses column lineage to understand input→output mappings
- Detects testable SQL constructs (CASE/WHEN, JOINs, NULLs, division, aggregation, incremental)
- Generates type-correct mock data with scenario coverage (happy path, null edge, boundary, incremental)
- Assembles complete YAML via the
yamllibrary - Returns rich semantic context (descriptions, lineage) for the LLM skill to refine values
Reuses existing infrastructure: parseManifest(), dbtLineage(), schema.inspect, sql.optimize, manifest caching.