Skip to content

Commit a85923b

Browse files
authored
docs: add explicit functional vs unit test scope rules to AGENTS.md (#1422)
Makes the unit vs functional test split explicit in AGENTS.md. The current section distinguishes the two by where they live and how they run, but the rule for *what each type should assert* was conveyed only through examples. A contributor could reasonably put specific-warning or compiled-SQL assertions in a functional test without tripping any review signal (surfaced in #1421 review). Adds two short paragraphs: the principle (functional = outcomes, unit = specifics) and a note that trivial macro additions do not need a test. ### Checklist - [x] I have run this code in development and it appears to resolve the stated issue - [x] This PR includes tests, or tests are not required/relevant for this PR - [ ] I have updated the `CHANGELOG.md` and added information about my change to the "dbt-databricks next" section. > Docs-only change; CHANGELOG entry intentionally omitted.
1 parent 60efeae commit a85923b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ hatch run pytest path/to/test_file.py::TestClass::test_method -v
8585
- Require live Databricks workspace
8686
- Run with: `hatch run cluster-e2e` (or `uc-cluster-e2e`, `sqlw-e2e`)
8787

88+
### What to Assert in Each Test Type
89+
90+
Functional tests assert user-visible outcomes: the model materializes and the resulting rows are correct. Unit and macro tests assert implementation details like the exact SQL a macro generates or the exact text of a warning.
91+
92+
When there is nothing meaningful to assert in either category, the change does not need a test.
93+
8894
### Test Environments
8995

9096
- **HMS Cluster** (`databricks_cluster`): Legacy Hive Metastore

0 commit comments

Comments
 (0)