Skip to content

Commit 15822a2

Browse files
committed
docs: add functional vs unit test scope rules to AGENTS.md
The split was conveyed only through examples (functional tests assert row counts; macro unit tests use assert_sql_equal), and a contributor could reasonably put specific-warning or compiled-SQL assertions in a functional test without tripping any review signal. Adds three short sentences stating the principle (functional = outcomes, unit = specifics), the litmus (would the assertion survive a future release that ships the same behavior via different SQL?), and a note that trivial macro additions do not need a test. Co-authored-by: Isaac
1 parent 59c69f6 commit 15822a2

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)